From 34b403f2e3f731cdd230e0e34768288b9dec0f8f Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Fri, 12 Dec 2025 11:04:13 +0100 Subject: [PATCH 1/7] chore: format generated files --- packages/sdk/src/index.gen.ts | 4 +- packages_generated/account/src/v3/api.gen.ts | 120 +- .../account/src/v3/marshalling.gen.ts | 208 +++- .../account/src/v3/types.gen.ts | 53 +- .../applesilicon/src/v1alpha1/api.gen.ts | 195 ++-- .../applesilicon/src/v1alpha1/content.gen.ts | 17 +- .../src/v1alpha1/marshalling.gen.ts | 184 ++- .../applesilicon/src/v1alpha1/types.gen.ts | 67 +- .../audit_trail/src/v1alpha1/api.gen.ts | 94 +- .../audit_trail/src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 299 +++-- .../audit_trail/src/v1alpha1/types.gen.ts | 108 +- .../autoscaling/src/v1alpha1/api.gen.ts | 118 +- .../autoscaling/src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 172 ++- .../autoscaling/src/v1alpha1/types.gen.ts | 52 +- .../baremetal/src/v1/api.gen.ts | 229 ++-- .../baremetal/src/v1/content.gen.ts | 8 +- .../baremetal/src/v1/marshalling.gen.ts | 213 +++- .../baremetal/src/v1/types.gen.ts | 116 +- .../baremetal/src/v3/api.gen.ts | 84 +- .../baremetal/src/v3/content.gen.ts | 12 +- .../baremetal/src/v3/index.gen.ts | 4 +- .../baremetal/src/v3/marshalling.gen.ts | 31 +- .../baremetal/src/v3/types.gen.ts | 11 +- .../billing/src/v2beta1/api.gen.ts | 135 ++- .../billing/src/v2beta1/index.gen.ts | 4 +- .../billing/src/v2beta1/marshalling.gen.ts | 45 +- .../billing/src/v2beta1/types.gen.ts | 33 +- packages_generated/block/src/v1/api.gen.ts | 130 ++- .../block/src/v1/content.gen.ts | 2 - packages_generated/block/src/v1/index.gen.ts | 4 +- .../block/src/v1/marshalling.gen.ts | 57 +- packages_generated/block/src/v1/types.gen.ts | 34 +- .../block/src/v1alpha1/api.gen.ts | 135 ++- .../block/src/v1alpha1/content.gen.ts | 2 - .../block/src/v1alpha1/index.gen.ts | 4 +- .../block/src/v1alpha1/marshalling.gen.ts | 57 +- .../block/src/v1alpha1/types.gen.ts | 35 +- packages_generated/cockpit/src/v1/api.gen.ts | 446 +++++--- .../cockpit/src/v1/marshalling.gen.ts | 168 ++- .../cockpit/src/v1/types.gen.ts | 105 +- .../container/src/v1beta1/api.gen.ts | 175 +-- .../container/src/v1beta1/content.gen.ts | 7 +- .../container/src/v1beta1/index.gen.ts | 4 +- .../container/src/v1beta1/marshalling.gen.ts | 246 ++-- .../container/src/v1beta1/types.gen.ts | 88 +- .../src/v1beta1/validation-rules.gen.ts | 3 +- .../datawarehouse/src/v1beta1/api.gen.ts | 139 ++- .../datawarehouse/src/v1beta1/content.gen.ts | 6 +- .../datawarehouse/src/v1beta1/index.gen.ts | 4 +- .../src/v1beta1/marshalling.gen.ts | 83 +- .../datawarehouse/src/v1beta1/types.gen.ts | 48 +- packages_generated/dedibox/src/v1/api.gen.ts | 1013 +++++++++-------- .../dedibox/src/v1/content.gen.ts | 13 +- .../dedibox/src/v1/marshalling.gen.ts | 289 +++-- .../dedibox/src/v1/types.gen.ts | 349 +----- .../domain/src/v2beta1/api.gen.ts | 409 ++++--- .../domain/src/v2beta1/content.gen.ts | 21 +- .../domain/src/v2beta1/marshalling.gen.ts | 899 ++++++++++----- .../domain/src/v2beta1/types.gen.ts | 241 +--- .../edge_services/src/v1beta1/api.gen.ts | 291 ++--- .../edge_services/src/v1beta1/content.gen.ts | 11 +- .../edge_services/src/v1beta1/index.gen.ts | 4 +- .../src/v1beta1/marshalling.gen.ts | 480 ++++---- .../edge_services/src/v1beta1/types.gen.ts | 168 +-- .../src/v1alpha1/api.gen.ts | 66 +- .../src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 40 +- .../src/v1alpha1/types.gen.ts | 19 +- .../file/src/v1alpha1/api.gen.ts | 63 +- .../file/src/v1alpha1/content.gen.ts | 6 +- .../file/src/v1alpha1/index.gen.ts | 4 +- .../file/src/v1alpha1/marshalling.gen.ts | 15 +- .../file/src/v1alpha1/types.gen.ts | 18 +- .../flexibleip/src/v1alpha1/api.gen.ts | 79 +- .../flexibleip/src/v1alpha1/content.gen.ts | 7 +- .../flexibleip/src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 23 +- .../flexibleip/src/v1alpha1/types.gen.ts | 30 +- .../function/src/v1beta1/api.gen.ts | 186 +-- .../function/src/v1beta1/content.gen.ts | 7 +- .../function/src/v1beta1/index.gen.ts | 4 +- .../function/src/v1beta1/marshalling.gen.ts | 159 ++- .../function/src/v1beta1/types.gen.ts | 83 +- .../iam/src/v1alpha1/api.gen.ts | 448 ++++---- .../iam/src/v1alpha1/index.gen.ts | 4 +- .../iam/src/v1alpha1/marshalling.gen.ts | 216 ++-- .../iam/src/v1alpha1/types.gen.ts | 166 +-- .../inference/src/v1/api.gen.ts | 115 +- .../inference/src/v1/content.gen.ts | 7 +- .../inference/src/v1/index.gen.ts | 4 +- .../inference/src/v1/marshalling.gen.ts | 110 +- .../inference/src/v1/types.gen.ts | 36 +- packages_generated/instance/src/v1/api.gen.ts | 425 ++++--- .../instance/src/v1/content.gen.ts | 23 +- .../instance/src/v1/index.gen.ts | 4 +- .../instance/src/v1/marshalling.gen.ts | 683 ++++++++--- .../instance/src/v1/types.gen.ts | 250 +--- .../instance/src/v1/types.private.gen.ts | 39 +- .../interlink/src/v1beta1/api.gen.ts | 140 ++- .../interlink/src/v1beta1/content.gen.ts | 16 +- .../interlink/src/v1beta1/index.gen.ts | 4 +- .../interlink/src/v1beta1/marshalling.gen.ts | 56 +- .../interlink/src/v1beta1/types.gen.ts | 59 +- packages_generated/iot/src/v1/api.gen.ts | 163 +-- packages_generated/iot/src/v1/content.gen.ts | 11 +- packages_generated/iot/src/v1/index.gen.ts | 4 +- .../iot/src/v1/marshalling.gen.ts | 207 +++- packages_generated/iot/src/v1/types.gen.ts | 105 +- packages_generated/ipam/src/v1/api.gen.ts | 89 +- packages_generated/ipam/src/v1/index.gen.ts | 4 +- .../ipam/src/v1/marshalling.gen.ts | 49 +- packages_generated/ipam/src/v1/types.gen.ts | 19 +- .../jobs/src/v1alpha1/api.gen.ts | 103 +- .../jobs/src/v1alpha1/content.gen.ts | 6 +- .../jobs/src/v1alpha1/index.gen.ts | 4 +- .../jobs/src/v1alpha1/marshalling.gen.ts | 85 +- .../jobs/src/v1alpha1/types.gen.ts | 41 +- .../jobs/src/v1alpha1/validation-rules.gen.ts | 6 +- packages_generated/k8s/src/v1/api.gen.ts | 205 ++-- packages_generated/k8s/src/v1/content.gen.ts | 8 +- packages_generated/k8s/src/v1/index.gen.ts | 4 +- .../k8s/src/v1/marshalling.gen.ts | 315 +++-- packages_generated/k8s/src/v1/types.gen.ts | 361 +++--- .../kafka/src/v1alpha1/api.gen.ts | 126 +- .../kafka/src/v1alpha1/content.gen.ts | 6 +- .../kafka/src/v1alpha1/index.gen.ts | 4 +- .../kafka/src/v1alpha1/marshalling.gen.ts | 126 +- .../kafka/src/v1alpha1/types.gen.ts | 55 +- .../src/v1alpha1/validation-rules.gen.ts | 9 +- .../key_manager/src/v1alpha1/api.gen.ts | 76 +- .../key_manager/src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 66 +- .../key_manager/src/v1alpha1/types.gen.ts | 41 +- packages_generated/lb/src/v1/api.gen.ts | 673 ++++++----- packages_generated/lb/src/v1/content.gen.ts | 6 +- .../lb/src/v1/marshalling.gen.ts | 720 ++++++++---- packages_generated/lb/src/v1/types.gen.ts | 223 +--- .../marketplace/src/v2/api.gen.ts | 66 +- .../marketplace/src/v2/index.gen.ts | 4 +- .../marketplace/src/v2/marshalling.gen.ts | 23 +- .../marketplace/src/v2/types.gen.ts | 29 +- packages_generated/mnq/src/v1beta1/api.gen.ts | 256 +++-- .../mnq/src/v1beta1/marshalling.gen.ts | 70 +- .../mnq/src/v1beta1/types.gen.ts | 52 +- packages_generated/mongodb/src/v1/api.gen.ts | 153 +-- .../mongodb/src/v1/content.gen.ts | 7 +- .../mongodb/src/v1/index.gen.ts | 4 +- .../mongodb/src/v1/marshalling.gen.ts | 125 +- .../mongodb/src/v1/types.gen.ts | 68 +- .../mongodb/src/v1alpha1/api.gen.ts | 149 ++- .../mongodb/src/v1alpha1/content.gen.ts | 7 +- .../mongodb/src/v1alpha1/index.gen.ts | 4 +- .../mongodb/src/v1alpha1/marshalling.gen.ts | 131 ++- .../mongodb/src/v1alpha1/types.gen.ts | 72 +- .../product_catalog/src/v2alpha1/api.gen.ts | 62 +- .../product_catalog/src/v2alpha1/index.gen.ts | 4 +- .../src/v2alpha1/marshalling.gen.ts | 308 ++--- .../product_catalog/src/v2alpha1/types.gen.ts | 160 +-- .../qaas/src/v1alpha1/api.gen.ts | 242 ++-- .../qaas/src/v1alpha1/content.gen.ts | 2 - .../qaas/src/v1alpha1/index.gen.ts | 4 +- .../qaas/src/v1alpha1/marshalling.gen.ts | 99 +- .../qaas/src/v1alpha1/types.gen.ts | 85 +- packages_generated/rdb/src/v1/api.gen.ts | 324 +++--- packages_generated/rdb/src/v1/content.gen.ts | 10 +- packages_generated/rdb/src/v1/index.gen.ts | 4 +- .../rdb/src/v1/marshalling.gen.ts | 379 ++++-- packages_generated/rdb/src/v1/types.gen.ts | 191 +--- packages_generated/redis/src/v1/api.gen.ts | 109 +- .../redis/src/v1/content.gen.ts | 6 +- packages_generated/redis/src/v1/index.gen.ts | 4 +- .../redis/src/v1/marshalling.gen.ts | 176 ++- packages_generated/redis/src/v1/types.gen.ts | 63 +- packages_generated/registry/src/v1/api.gen.ts | 88 +- .../registry/src/v1/content.gen.ts | 20 +- .../registry/src/v1/index.gen.ts | 4 +- .../registry/src/v1/marshalling.gen.ts | 25 +- .../registry/src/v1/types.gen.ts | 36 +- .../s2s_vpn/src/v1alpha1/api.gen.ts | 153 ++- .../s2s_vpn/src/v1alpha1/content.gen.ts | 6 +- .../s2s_vpn/src/v1alpha1/index.gen.ts | 4 +- .../s2s_vpn/src/v1alpha1/marshalling.gen.ts | 161 ++- .../s2s_vpn/src/v1alpha1/types.gen.ts | 62 +- .../secret/src/v1beta1/api.gen.ts | 137 ++- .../secret/src/v1beta1/index.gen.ts | 4 +- .../secret/src/v1beta1/marshalling.gen.ts | 82 +- .../secret/src/v1beta1/types.gen.ts | 70 +- .../serverless_sqldb/src/v1alpha1/api.gen.ts | 60 +- .../src/v1alpha1/content.gen.ts | 6 +- .../src/v1alpha1/index.gen.ts | 4 +- .../src/v1alpha1/marshalling.gen.ts | 15 +- .../src/v1alpha1/types.gen.ts | 17 +- .../tem/src/v1alpha1/api.gen.ts | 165 +-- .../tem/src/v1alpha1/content.gen.ts | 12 +- .../tem/src/v1alpha1/index.gen.ts | 4 +- .../tem/src/v1alpha1/marshalling.gen.ts | 166 ++- .../tem/src/v1alpha1/types.gen.ts | 87 +- packages_generated/test/src/v1/api.gen.ts | 27 +- packages_generated/test/src/v1/content.gen.ts | 10 +- packages_generated/test/src/v1/index.gen.ts | 4 +- .../test/src/v1/marshalling.gen.ts | 22 +- packages_generated/test/src/v1/types.gen.ts | 22 +- packages_generated/vpc/src/v2/api.gen.ts | 108 +- packages_generated/vpc/src/v2/index.gen.ts | 4 +- .../vpc/src/v2/marshalling.gen.ts | 29 +- packages_generated/vpc/src/v2/types.gen.ts | 53 +- packages_generated/vpcgw/src/v1/api.gen.ts | 249 ++-- .../vpcgw/src/v1/content.gen.ts | 7 +- packages_generated/vpcgw/src/v1/index.gen.ts | 4 +- .../vpcgw/src/v1/marshalling.gen.ts | 117 +- packages_generated/vpcgw/src/v1/types.gen.ts | 73 +- packages_generated/vpcgw/src/v2/api.gen.ts | 163 ++- .../vpcgw/src/v2/content.gen.ts | 7 +- packages_generated/vpcgw/src/v2/index.gen.ts | 4 +- .../vpcgw/src/v2/marshalling.gen.ts | 48 +- packages_generated/vpcgw/src/v2/types.gen.ts | 51 +- .../webhosting/src/v1/api.gen.ts | 549 ++++----- .../webhosting/src/v1/content.gen.ts | 15 +- .../webhosting/src/v1/marshalling.gen.ts | 209 +++- .../webhosting/src/v1/types.gen.ts | 169 +-- 222 files changed, 11479 insertions(+), 11645 deletions(-) diff --git a/packages/sdk/src/index.gen.ts b/packages/sdk/src/index.gen.ts index f63b6261d..bcac9eba4 100644 --- a/packages/sdk/src/index.gen.ts +++ b/packages/sdk/src/index.gen.ts @@ -46,7 +46,8 @@ import { Testv1 } from '@scaleway/sdk-test' import { Vpcv2 } from '@scaleway/sdk-vpc' import { Vpcgwv1, Vpcgwv2 } from '@scaleway/sdk-vpcgw' import { Webhostingv1 } from '@scaleway/sdk-webhosting' -export { createClient, createAdvancedClient } from '@scaleway/sdk-client' + +export { createAdvancedClient, createClient } from '@scaleway/sdk-client' /** * @deprecated Direct version exports are deprecated. Use the 'Account' namespace instead (e.g., Account.v1). @@ -404,4 +405,3 @@ export { Webhostingv1 } export const Webhosting = { v1: Webhostingv1, } - diff --git a/packages_generated/account/src/v3/api.gen.ts b/packages_generated/account/src/v3/api.gen.ts index 6e2eae814..ff6f0e1d2 100644 --- a/packages_generated/account/src/v3/api.gen.ts +++ b/packages_generated/account/src/v3/api.gen.ts @@ -55,31 +55,32 @@ export class ContractAPI extends ParentAPI { * @param request - The request {@link ContractApiDownloadContractSignatureRequest} * @returns A Promise of Blob */ - downloadContractSignature = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/account/v3/contract-signatures/${validatePathParam('contractSignatureId', request.contractSignatureId)}/download`, - urlParams: urlParams( - ['dl', 1], - ['locale', request.locale], - ), - responseType: 'blob', - }, - ) + downloadContractSignature = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'GET', + path: `/account/v3/contract-signatures/${validatePathParam('contractSignatureId', request.contractSignatureId)}/download`, + urlParams: urlParams(['dl', 1], ['locale', request.locale]), + responseType: 'blob', + }) - /** * Create a signature for your Organization for the latest version of the requested contract. * * @param request - The request {@link ContractApiCreateContractSignatureRequest} * @returns A Promise of ContractSignature */ - createContractSignature = (request: Readonly) => + createContractSignature = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalContractApiCreateContractSignatureRequest(request, this.client.settings), + marshalContractApiCreateContractSignatureRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -88,14 +89,15 @@ export class ContractAPI extends ParentAPI { unmarshalContractSignature, ) - /** * Sign a contract for your Organization. * * @param request - The request {@link ContractApiValidateContractSignatureRequest} * @returns A Promise of ContractSignature */ - validateContractSignature = (request: Readonly) => + validateContractSignature = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -106,18 +108,22 @@ export class ContractAPI extends ParentAPI { unmarshalContractSignature, ) - /** * Check if a contract is signed for your Organization. * * @param request - The request {@link ContractApiCheckContractSignatureRequest} * @returns A Promise of CheckContractSignatureResponse */ - checkContractSignature = (request: Readonly) => + checkContractSignature = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalContractApiCheckContractSignatureRequest(request, this.client.settings), + marshalContractApiCheckContractSignatureRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -126,32 +132,44 @@ export class ContractAPI extends ParentAPI { unmarshalCheckContractSignatureResponse, ) - - protected pageOfListContractSignatures = (request: Readonly = {}) => + protected pageOfListContractSignatures = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/account/v3/contract-signatures`, urlParams: urlParams( ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListContractSignaturesResponse, ) - + /** * List contract signatures for an Organization. * * @param request - The request {@link ContractApiListContractSignaturesRequest} * @returns A Promise of ListContractSignaturesResponse */ - listContractSignatures = (request: Readonly = {}) => - enrichForPagination('contractSignatures', this.pageOfListContractSignatures, request) - - + listContractSignatures = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'contractSignatures', + this.pageOfListContractSignatures, + request, + ) } /** @@ -179,8 +197,9 @@ export class ProjectAPI extends ParentAPI { unmarshalProject, ) - - protected pageOfListProjects = (request: Readonly = {}) => + protected pageOfListProjects = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -188,15 +207,22 @@ export class ProjectAPI extends ParentAPI { urlParams: urlParams( ['name', request.name], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_ids', request.projectIds], ), }, unmarshalListProjectsResponse, ) - + /** * List all Projects of an Organization. List all Projects of an Organization. The response will include the total number of Projects as well as their associated Organizations, names, and IDs. Other information includes the creation and update date of the Project. * @@ -206,7 +232,6 @@ export class ProjectAPI extends ParentAPI { listProjects = (request: Readonly = {}) => enrichForPagination('projects', this.pageOfListProjects, request) - /** * Get an existing Project. Retrieve information about an existing Project, specified by its Project ID. Its full details, including ID, name and description, are returned in the response object. * @@ -222,21 +247,17 @@ export class ProjectAPI extends ParentAPI { unmarshalProject, ) - /** * Delete an existing Project. Delete an existing Project, specified by its Project ID. The Project needs to be empty (meaning there are no resources left in it) to be deleted effectively. Note that deleting a Project is permanent, and cannot be undone. * * @param request - The request {@link ProjectApiDeleteProjectRequest} */ deleteProject = (request: Readonly = {}) => - this.client.fetch( - { - method: 'DELETE', - path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/account/v3/projects/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`, + }) - /** * Update Project. Update the parameters of an existing Project, specified by its Project ID. These parameters include the name and description. * @@ -256,18 +277,22 @@ export class ProjectAPI extends ParentAPI { unmarshalProject, ) - /** * Set project use case. Set the project use case for a new or existing Project, specified by its Project ID. You can customize the use case, sub use case, and architecture type you want to use in the Project. * * @param request - The request {@link ProjectApiSetProjectQualificationRequest} * @returns A Promise of ProjectQualification */ - setProjectQualification = (request: Readonly = {}) => + setProjectQualification = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalProjectApiSetProjectQualificationRequest(request, this.client.settings), + marshalProjectApiSetProjectQualificationRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -275,7 +300,4 @@ export class ProjectAPI extends ParentAPI { }, unmarshalProjectQualification, ) - - } - diff --git a/packages_generated/account/src/v3/marshalling.gen.ts b/packages_generated/account/src/v3/marshalling.gen.ts index 7344508fc..01cef1581 100644 --- a/packages_generated/account/src/v3/marshalling.gen.ts +++ b/packages_generated/account/src/v3/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Contract, @@ -45,7 +50,9 @@ const unmarshalContract = (data: unknown): Contract => { } as Contract } -export const unmarshalContractSignature = (data: unknown): ContractSignature => { +export const unmarshalContractSignature = ( + data: unknown, +): ContractSignature => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContractSignature' failed as data isn't a dictionary.`, @@ -62,7 +69,9 @@ export const unmarshalContractSignature = (data: unknown): ContractSignature => } as ContractSignature } -const unmarshalQualificationAiMachine = (data: unknown): QualificationAiMachine => { +const unmarshalQualificationAiMachine = ( + data: unknown, +): QualificationAiMachine => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationAiMachine' failed as data isn't a dictionary.`, @@ -74,7 +83,9 @@ const unmarshalQualificationAiMachine = (data: unknown): QualificationAiMachine } as QualificationAiMachine } -const unmarshalQualificationArchiveData = (data: unknown): QualificationArchiveData => { +const unmarshalQualificationArchiveData = ( + data: unknown, +): QualificationArchiveData => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationArchiveData' failed as data isn't a dictionary.`, @@ -86,7 +97,9 @@ const unmarshalQualificationArchiveData = (data: unknown): QualificationArchiveD } as QualificationArchiveData } -const unmarshalQualificationContainer = (data: unknown): QualificationContainer => { +const unmarshalQualificationContainer = ( + data: unknown, +): QualificationContainer => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationContainer' failed as data isn't a dictionary.`, @@ -98,7 +111,9 @@ const unmarshalQualificationContainer = (data: unknown): QualificationContainer } as QualificationContainer } -const unmarshalQualificationDeploySoftware = (data: unknown): QualificationDeploySoftware => { +const unmarshalQualificationDeploySoftware = ( + data: unknown, +): QualificationDeploySoftware => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationDeploySoftware' failed as data isn't a dictionary.`, @@ -110,7 +125,9 @@ const unmarshalQualificationDeploySoftware = (data: unknown): QualificationDeplo } as QualificationDeploySoftware } -const unmarshalQualificationHostApplication = (data: unknown): QualificationHostApplication => { +const unmarshalQualificationHostApplication = ( + data: unknown, +): QualificationHostApplication => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationHostApplication' failed as data isn't a dictionary.`, @@ -122,7 +139,9 @@ const unmarshalQualificationHostApplication = (data: unknown): QualificationHost } as QualificationHostApplication } -const unmarshalQualificationHostWebsite = (data: unknown): QualificationHostWebsite => { +const unmarshalQualificationHostWebsite = ( + data: unknown, +): QualificationHostWebsite => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationHostWebsite' failed as data isn't a dictionary.`, @@ -134,7 +153,9 @@ const unmarshalQualificationHostWebsite = (data: unknown): QualificationHostWebs } as QualificationHostWebsite } -const unmarshalQualificationOtherUseCase = (data: unknown): QualificationOtherUseCase => { +const unmarshalQualificationOtherUseCase = ( + data: unknown, +): QualificationOtherUseCase => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationOtherUseCase' failed as data isn't a dictionary.`, @@ -146,7 +167,9 @@ const unmarshalQualificationOtherUseCase = (data: unknown): QualificationOtherUs } as QualificationOtherUseCase } -const unmarshalQualificationSetScalewayEnvironment = (data: unknown): QualificationSetScalewayEnvironment => { +const unmarshalQualificationSetScalewayEnvironment = ( + data: unknown, +): QualificationSetScalewayEnvironment => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationSetScalewayEnvironment' failed as data isn't a dictionary.`, @@ -158,7 +181,9 @@ const unmarshalQualificationSetScalewayEnvironment = (data: unknown): Qualificat } as QualificationSetScalewayEnvironment } -const unmarshalQualificationShareData = (data: unknown): QualificationShareData => { +const unmarshalQualificationShareData = ( + data: unknown, +): QualificationShareData => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'QualificationShareData' failed as data isn't a dictionary.`, @@ -178,16 +203,36 @@ const unmarshalQualification = (data: unknown): Qualification => { } return { - aiMachine: data.ai_machine ? unmarshalQualificationAiMachine(data.ai_machine) : undefined, + aiMachine: data.ai_machine + ? unmarshalQualificationAiMachine(data.ai_machine) + : undefined, architectureType: data.architecture_type, - archiveData: data.archive_data ? unmarshalQualificationArchiveData(data.archive_data) : undefined, - container: data.container ? unmarshalQualificationContainer(data.container) : undefined, - deploySoftware: data.deploy_software ? unmarshalQualificationDeploySoftware(data.deploy_software) : undefined, - hostApplication: data.host_application ? unmarshalQualificationHostApplication(data.host_application) : undefined, - hostWebsite: data.host_website ? unmarshalQualificationHostWebsite(data.host_website) : undefined, - otherUseCase: data.other_use_case ? unmarshalQualificationOtherUseCase(data.other_use_case) : undefined, - setScalewayEnvironment: data.set_scaleway_environment ? unmarshalQualificationSetScalewayEnvironment(data.set_scaleway_environment) : undefined, - shareData: data.share_data ? unmarshalQualificationShareData(data.share_data) : undefined, + archiveData: data.archive_data + ? unmarshalQualificationArchiveData(data.archive_data) + : undefined, + container: data.container + ? unmarshalQualificationContainer(data.container) + : undefined, + deploySoftware: data.deploy_software + ? unmarshalQualificationDeploySoftware(data.deploy_software) + : undefined, + hostApplication: data.host_application + ? unmarshalQualificationHostApplication(data.host_application) + : undefined, + hostWebsite: data.host_website + ? unmarshalQualificationHostWebsite(data.host_website) + : undefined, + otherUseCase: data.other_use_case + ? unmarshalQualificationOtherUseCase(data.other_use_case) + : undefined, + setScalewayEnvironment: data.set_scaleway_environment + ? unmarshalQualificationSetScalewayEnvironment( + data.set_scaleway_environment, + ) + : undefined, + shareData: data.share_data + ? unmarshalQualificationShareData(data.share_data) + : undefined, } as Qualification } @@ -204,12 +249,16 @@ export const unmarshalProject = (data: unknown): Project => { id: data.id, name: data.name, organizationId: data.organization_id, - qualification: data.qualification ? unmarshalQualification(data.qualification) : undefined, + qualification: data.qualification + ? unmarshalQualification(data.qualification) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as Project } -export const unmarshalCheckContractSignatureResponse = (data: unknown): CheckContractSignatureResponse => { +export const unmarshalCheckContractSignatureResponse = ( + data: unknown, +): CheckContractSignatureResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckContractSignatureResponse' failed as data isn't a dictionary.`, @@ -222,7 +271,9 @@ export const unmarshalCheckContractSignatureResponse = (data: unknown): CheckCon } as CheckContractSignatureResponse } -export const unmarshalListContractSignaturesResponse = (data: unknown): ListContractSignaturesResponse => { +export const unmarshalListContractSignaturesResponse = ( + data: unknown, +): ListContractSignaturesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListContractSignaturesResponse' failed as data isn't a dictionary.`, @@ -230,12 +281,17 @@ export const unmarshalListContractSignaturesResponse = (data: unknown): ListCont } return { - contractSignatures: unmarshalArrayOfObject(data.contract_signatures, unmarshalContractSignature), + contractSignatures: unmarshalArrayOfObject( + data.contract_signatures, + unmarshalContractSignature, + ), totalCount: data.total_count, } as ListContractSignaturesResponse } -export const unmarshalListProjectsResponse = (data: unknown): ListProjectsResponse => { +export const unmarshalListProjectsResponse = ( + data: unknown, +): ListProjectsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListProjectsResponse' failed as data isn't a dictionary.`, @@ -248,7 +304,9 @@ export const unmarshalListProjectsResponse = (data: unknown): ListProjectsRespon } as ListProjectsResponse } -export const unmarshalProjectQualification = (data: unknown): ProjectQualification => { +export const unmarshalProjectQualification = ( + data: unknown, +): ProjectQualification => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ProjectQualification' failed as data isn't a dictionary.`, @@ -257,7 +315,9 @@ export const unmarshalProjectQualification = (data: unknown): ProjectQualificati return { projectId: data.project_id, - qualification: data.qualification ? unmarshalQualification(data.qualification) : undefined, + qualification: data.qualification + ? unmarshalQualification(data.qualification) + : undefined, } as ProjectQualification } @@ -356,43 +416,76 @@ const marshalQualification = ( request: Qualification, defaults: DefaultValues, ): Record => ({ - architecture_type: request.architectureType, + architecture_type: request.architectureType, ...resolveOneOf([ - {param: 'host_website', - value: (request.hostWebsite !== undefined) ? marshalQualificationHostWebsite(request.hostWebsite, defaults) - : undefined, + { + param: 'host_website', + value: + request.hostWebsite !== undefined + ? marshalQualificationHostWebsite(request.hostWebsite, defaults) + : undefined, }, - {param: 'host_application', - value: (request.hostApplication !== undefined) ? marshalQualificationHostApplication(request.hostApplication, defaults) - : undefined, + { + param: 'host_application', + value: + request.hostApplication !== undefined + ? marshalQualificationHostApplication( + request.hostApplication, + defaults, + ) + : undefined, }, - {param: 'deploy_software', - value: (request.deploySoftware !== undefined) ? marshalQualificationDeploySoftware(request.deploySoftware, defaults) - : undefined, + { + param: 'deploy_software', + value: + request.deploySoftware !== undefined + ? marshalQualificationDeploySoftware(request.deploySoftware, defaults) + : undefined, }, - {param: 'set_scaleway_environment', - value: (request.setScalewayEnvironment !== undefined) ? marshalQualificationSetScalewayEnvironment(request.setScalewayEnvironment, defaults) - : undefined, + { + param: 'set_scaleway_environment', + value: + request.setScalewayEnvironment !== undefined + ? marshalQualificationSetScalewayEnvironment( + request.setScalewayEnvironment, + defaults, + ) + : undefined, }, - {param: 'ai_machine', - value: (request.aiMachine !== undefined) ? marshalQualificationAiMachine(request.aiMachine, defaults) - : undefined, + { + param: 'ai_machine', + value: + request.aiMachine !== undefined + ? marshalQualificationAiMachine(request.aiMachine, defaults) + : undefined, }, - {param: 'container', - value: (request.container !== undefined) ? marshalQualificationContainer(request.container, defaults) - : undefined, + { + param: 'container', + value: + request.container !== undefined + ? marshalQualificationContainer(request.container, defaults) + : undefined, }, - {param: 'archive_data', - value: (request.archiveData !== undefined) ? marshalQualificationArchiveData(request.archiveData, defaults) - : undefined, + { + param: 'archive_data', + value: + request.archiveData !== undefined + ? marshalQualificationArchiveData(request.archiveData, defaults) + : undefined, }, - {param: 'share_data', - value: (request.shareData !== undefined) ? marshalQualificationShareData(request.shareData, defaults) - : undefined, + { + param: 'share_data', + value: + request.shareData !== undefined + ? marshalQualificationShareData(request.shareData, defaults) + : undefined, }, - {param: 'other_use_case', - value: (request.otherUseCase !== undefined) ? marshalQualificationOtherUseCase(request.otherUseCase, defaults) - : undefined, + { + param: 'other_use_case', + value: + request.otherUseCase !== undefined + ? marshalQualificationOtherUseCase(request.otherUseCase, defaults) + : undefined, }, ]), }) @@ -401,7 +494,10 @@ export const marshalProjectApiSetProjectQualificationRequest = ( request: ProjectApiSetProjectQualificationRequest, defaults: DefaultValues, ): Record => ({ - qualification: ((request.qualification !== undefined) ? marshalQualification(request.qualification, defaults): undefined), + qualification: + request.qualification !== undefined + ? marshalQualification(request.qualification, defaults) + : undefined, }) export const marshalProjectApiUpdateProjectRequest = ( diff --git a/packages_generated/account/src/v3/types.gen.ts b/packages_generated/account/src/v3/types.gen.ts index 422850390..f7adf9162 100644 --- a/packages_generated/account/src/v3/types.gen.ts +++ b/packages_generated/account/src/v3/types.gen.ts @@ -1,6 +1,4 @@ - -import type {LanguageCode as StdLanguageCode,} from '@scaleway/sdk-std' - +import type { LanguageCode as StdLanguageCode } from '@scaleway/sdk-std' export type ContractType = | 'unknown_type' @@ -25,8 +23,7 @@ export type ListProjectsRequestOrderBy = | 'name_asc' | 'name_desc' -export type QualificationAiMachineSubUseCase = - | 'unknown_sub_use_case' +export type QualificationAiMachineSubUseCase = 'unknown_sub_use_case' export type QualificationArchitectureType = | 'unknown_architecture_type' @@ -39,14 +36,11 @@ export type QualificationArchitectureType = | 'dedicated_server' | 'other_architecture_type' -export type QualificationArchiveDataSubUseCase = - | 'unknown_sub_use_case' +export type QualificationArchiveDataSubUseCase = 'unknown_sub_use_case' -export type QualificationContainerSubUseCase = - | 'unknown_sub_use_case' +export type QualificationContainerSubUseCase = 'unknown_sub_use_case' -export type QualificationDeploySoftwareSubUseCase = - | 'unknown_sub_use_case' +export type QualificationDeploySoftwareSubUseCase = 'unknown_sub_use_case' export type QualificationHostApplicationSubUseCase = | 'unknown_sub_use_case' @@ -60,60 +54,49 @@ export type QualificationHostWebsiteSubUseCase = | 'high_website' | 'other_sub_use_case' -export type QualificationOtherUseCaseSubUseCase = - | 'unknown_sub_use_case' +export type QualificationOtherUseCaseSubUseCase = 'unknown_sub_use_case' export type QualificationSetScalewayEnvironmentSubUseCase = - | 'unknown_sub_use_case' + 'unknown_sub_use_case' -export type QualificationShareDataSubUseCase = - | 'unknown_sub_use_case' +export type QualificationShareDataSubUseCase = 'unknown_sub_use_case' export interface QualificationAiMachine { subUseCase: QualificationAiMachineSubUseCase } - export interface QualificationArchiveData { subUseCase: QualificationArchiveDataSubUseCase } - export interface QualificationContainer { subUseCase: QualificationContainerSubUseCase } - export interface QualificationDeploySoftware { subUseCase: QualificationDeploySoftwareSubUseCase } - export interface QualificationHostApplication { subUseCase: QualificationHostApplicationSubUseCase } - export interface QualificationHostWebsite { subUseCase: QualificationHostWebsiteSubUseCase } - export interface QualificationOtherUseCase { subUseCase: QualificationOtherUseCaseSubUseCase } - export interface QualificationSetScalewayEnvironment { subUseCase: QualificationSetScalewayEnvironmentSubUseCase } - export interface QualificationShareData { subUseCase: QualificationShareDataSubUseCase } - export interface Contract { /** * ID of the contract. @@ -141,7 +124,6 @@ export interface Contract { updatedAt?: Date } - export interface Qualification { /** * Architecture type of the qualification. @@ -194,7 +176,6 @@ export interface Qualification { otherUseCase?: QualificationOtherUseCase } - export interface ContractSignature { /** * ID of the contract signature. @@ -222,7 +203,6 @@ export interface ContractSignature { contract?: Contract } - export interface Project { /** * ID of the Project. @@ -254,7 +234,6 @@ export interface Project { qualification?: Qualification } - export interface CheckContractSignatureResponse { /** * Whether a signature has been requested for this contract. @@ -266,7 +245,6 @@ export interface CheckContractSignatureResponse { validated: boolean } - export type ContractApiCheckContractSignatureRequest = { /** * ID of the Organization to check the contract signature for. @@ -282,7 +260,6 @@ export type ContractApiCheckContractSignatureRequest = { contractName: string } - export type ContractApiCreateContractSignatureRequest = { /** * The type of the contract. @@ -302,7 +279,6 @@ export type ContractApiCreateContractSignatureRequest = { organizationId?: string } - export type ContractApiDownloadContractSignatureRequest = { /** * The contract signature ID. @@ -314,7 +290,6 @@ export type ContractApiDownloadContractSignatureRequest = { locale?: StdLanguageCode } - export type ContractApiListContractSignaturesRequest = { /** * The page number for the returned contracts. @@ -334,7 +309,6 @@ export type ContractApiListContractSignaturesRequest = { organizationId?: string } - export type ContractApiValidateContractSignatureRequest = { /** * The contract linked to your Organization you want to sign. @@ -342,7 +316,6 @@ export type ContractApiValidateContractSignatureRequest = { contractSignatureId: string } - export interface ListContractSignaturesResponse { /** * The total number of contract signatures. @@ -354,7 +327,6 @@ export interface ListContractSignaturesResponse { contractSignatures: ContractSignature[] } - export interface ListProjectsResponse { /** * Total number of Projects. @@ -366,7 +338,6 @@ export interface ListProjectsResponse { projects: Project[] } - export type ProjectApiCreateProjectRequest = { /** * Name of the Project. @@ -382,7 +353,6 @@ export type ProjectApiCreateProjectRequest = { description: string } - export type ProjectApiDeleteProjectRequest = { /** * Project ID of the Project. @@ -390,7 +360,6 @@ export type ProjectApiDeleteProjectRequest = { projectId?: string } - export type ProjectApiGetProjectRequest = { /** * Project ID of the Project. @@ -398,7 +367,6 @@ export type ProjectApiGetProjectRequest = { projectId?: string } - export type ProjectApiListProjectsRequest = { /** * Organization ID of the Project. @@ -426,7 +394,6 @@ export type ProjectApiListProjectsRequest = { projectIds?: string[] } - export type ProjectApiSetProjectQualificationRequest = { /** * Project ID. @@ -438,7 +405,6 @@ export type ProjectApiSetProjectQualificationRequest = { qualification?: Qualification } - export type ProjectApiUpdateProjectRequest = { /** * Project ID of the Project. @@ -454,7 +420,6 @@ export type ProjectApiUpdateProjectRequest = { description?: string } - export interface ProjectQualification { /** * Project ID. @@ -465,5 +430,3 @@ export interface ProjectQualification { */ qualification?: Qualification } - - diff --git a/packages_generated/applesilicon/src/v1alpha1/api.gen.ts b/packages_generated/applesilicon/src/v1alpha1/api.gen.ts index 84f054a33..38d7cd3ec 100644 --- a/packages_generated/applesilicon/src/v1alpha1/api.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/api.gen.ts @@ -8,8 +8,12 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {RUNNER_TRANSIENT_STATUSES as RUNNER_TRANSIENT_STATUSES_APPLESILICON,SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES as SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON,SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + RUNNER_TRANSIENT_STATUSES as RUNNER_TRANSIENT_STATUSES_APPLESILICON, + SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES as SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON, + SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_APPLESILICON, +} from './content.gen.js' import { marshalBatchCreateServersRequest, unmarshalBatchCreateServersResponse, @@ -90,13 +94,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: ['fr-par-3'], + }) + /** * List server types. List all technical details about Apple silicon server types available in the specified zone. Since there is only one Availability Zone for Apple silicon servers, the targeted value is `fr-par-3`. * @@ -112,7 +113,6 @@ export class API extends ParentAPI { unmarshalListServerTypesResponse, ) - /** * Get a server type. Get technical details (CPU, disk size etc.) of a server type. * @@ -128,7 +128,6 @@ export class API extends ParentAPI { unmarshalServerType, ) - /** * Create a server. Create a new server in the targeted zone, specifying its configuration including name and type. * @@ -148,7 +147,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Create multiple servers atomically. Create multiple servers in the targeted zone specifying their configurations. If the request cannot entirely be fulfilled, no servers are created. * @@ -168,7 +166,6 @@ export class API extends ParentAPI { unmarshalBatchCreateServersResponse, ) - protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -178,13 +175,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListServersResponse, ) - + /** * List all servers. List all servers in the specified zone. By default, returned servers in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -194,7 +194,6 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) - protected pageOfListOS = (request: Readonly = {}) => this.client.fetch( { @@ -203,13 +202,16 @@ export class API extends ParentAPI { urlParams: urlParams( ['name', request.name], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['server_type', request.serverType], ), }, unmarshalListOSResponse, ) - + /** * List all Operating Systems (OS). List all Operating Systems (OS). The response will include the total number of OS as well as their associated IDs, names and labels. * @@ -219,7 +221,6 @@ export class API extends ParentAPI { listOS = (request: Readonly = {}) => enrichForPagination('os', this.pageOfListOS, request) - /** * Get an Operating System (OS). Get an Operating System (OS). The response will include the OS's unique ID as well as its name and label. * @@ -235,7 +236,6 @@ export class API extends ParentAPI { unmarshalOS, ) - /** * Get a server. Retrieve information about an existing Apple silicon server, specified by its server ID. Its full details, including name, status and IP address, are returned in the response object. * @@ -250,7 +250,7 @@ export class API extends ParentAPI { }, unmarshalServer, ) - + /** * Waits for {@link Server} to be in a final state. * @@ -263,13 +263,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status), + )), this.getServer, request, options, ) - /** * Update a server. Update the parameters of an existing Apple silicon server, specified by its server ID. * @@ -289,21 +292,17 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Delete a server. Delete an existing Apple silicon server, specified by its server ID. Deleting a server is permanent, and cannot be undone. Note that the minimum allocation period for Apple silicon-as-a-service is 24 hours, meaning you cannot delete your server prior to that. * * @param request - The request {@link DeleteServerRequest} */ deleteServer = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, + }) - /** * Reboot a server. Reboot an existing Apple silicon server, specified by its server ID. * @@ -321,7 +320,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Reinstall a server. Reinstall an existing Apple silicon server (specified by its server ID) from a new image (OS). All the data on the disk is deleted and all configuration is reset to the default configuration values of the image (OS). * @@ -341,12 +339,16 @@ export class API extends ParentAPI { unmarshalServer, ) - - startConnectivityDiagnostic = (request: Readonly) => + startConnectivityDiagnostic = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalStartConnectivityDiagnosticRequest(request, this.client.settings), + marshalStartConnectivityDiagnosticRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -355,8 +357,9 @@ export class API extends ParentAPI { unmarshalStartConnectivityDiagnosticResponse, ) - - getConnectivityDiagnostic = (request: Readonly) => + getConnectivityDiagnostic = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -365,7 +368,6 @@ export class API extends ParentAPI { unmarshalConnectivityDiagnostic, ) - /** * Create a new runner configuration. * @@ -385,7 +387,6 @@ export class API extends ParentAPI { unmarshalRunner, ) - /** * Retrieve a runner configuration. * @@ -400,7 +401,7 @@ export class API extends ParentAPI { }, unmarshalRunner, ) - + /** * Waits for {@link Runner} to be in a final state. * @@ -413,13 +414,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!RUNNER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !RUNNER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status), + )), this.getRunner, request, options, ) - protected pageOfListRunners = (request: Readonly = {}) => this.client.fetch( { @@ -428,14 +432,17 @@ export class API extends ParentAPI { urlParams: urlParams( ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['server_id', request.serverId], ), }, unmarshalListRunnersResponse, ) - + /** * List runner configurations associated with a server. * @@ -445,7 +452,6 @@ export class API extends ParentAPI { listRunners = (request: Readonly = {}) => enrichForPagination('runners', this.pageOfListRunners, request) - /** * Create a new runner configuration. * @@ -465,21 +471,16 @@ export class API extends ParentAPI { unmarshalRunner, ) - /** * Create a new runner configuration. * * @param request - The request {@link DeleteRunnerRequest} */ deleteRunner = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam('runnerId', request.runnerId)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/runners/${validatePathParam('runnerId', request.runnerId)}`, + }) } /** @@ -490,15 +491,13 @@ export class PrivateNetworkAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-3', - ], - }) - - getServerPrivateNetwork = (request: Readonly) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: ['fr-par-1', 'fr-par-3'], + }) + + getServerPrivateNetwork = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -506,7 +505,7 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalServerPrivateNetwork, ) - + /** * Waits for {@link ServerPrivateNetwork} to be in a final state. * @@ -519,24 +518,34 @@ export class PrivateNetworkAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES_APPLESILICON.includes( + res.status, + ), + )), this.getServerPrivateNetwork, request, options, ) - /** * Add a server to a Private Network. Add an Apple silicon server to a Private Network. * * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest} * @returns A Promise of ServerPrivateNetwork */ - addServerPrivateNetwork = (request: Readonly) => + addServerPrivateNetwork = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings), + marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -545,18 +554,22 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalServerPrivateNetwork, ) - /** * Set multiple Private Networks on a server. Configure multiple Private Networks on an Apple silicon server. * * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest} * @returns A Promise of SetServerPrivateNetworksResponse */ - setServerPrivateNetworks = (request: Readonly) => + setServerPrivateNetworks = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings), + marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -565,8 +578,9 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalSetServerPrivateNetworksResponse, ) - - protected pageOfListServerPrivateNetworks = (request: Readonly = {}) => + protected pageOfListServerPrivateNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -576,7 +590,10 @@ export class PrivateNetworkAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId], @@ -584,30 +601,32 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalListServerPrivateNetworksResponse, ) - + /** * List the Private Networks of a server. List the Private Networks of an Apple silicon server. * * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest} * @returns A Promise of ListServerPrivateNetworksResponse */ - listServerPrivateNetworks = (request: Readonly = {}) => - enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request) + listServerPrivateNetworks = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'serverPrivateNetworks', + this.pageOfListServerPrivateNetworks, + request, + ) - /** * Delete a Private Network. * * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} */ - deleteServerPrivateNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }, - ) - - + deleteServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/apple-silicon/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }) } - diff --git a/packages_generated/applesilicon/src/v1alpha1/content.gen.ts b/packages_generated/applesilicon/src/v1alpha1/content.gen.ts index f72d70483..6222053f5 100644 --- a/packages_generated/applesilicon/src/v1alpha1/content.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/content.gen.ts @@ -7,22 +7,16 @@ import type { ServerStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link RunnerStatus}. */ -export const RUNNER_TRANSIENT_STATUSES: RunnerStatus[] = [ - 'waiting', -] +export const RUNNER_TRANSIENT_STATUSES: RunnerStatus[] = ['waiting'] /** Lists transient statutes of the enum {@link ServerPrivateNetworkServerStatus}. */ -export const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[] = [ - 'attaching', - 'detaching', -] +export const SERVER_PRIVATE_NETWORK_SERVER_TRANSIENT_STATUSES: ServerPrivateNetworkServerStatus[] = + ['attaching', 'detaching'] /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ -export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = [ - 'vpc_updating', -] +export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = + ['vpc_updating'] /** Lists transient statutes of the enum {@link ServerStatus}. */ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ @@ -34,4 +28,3 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ 'reinstalling', 'busy', ] - diff --git a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts index 7da93d6f3..1589fd474 100644 --- a/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { OSSupportedServerType, @@ -45,7 +50,9 @@ import type { UpdateServerRequest, } from './types.gen.js' -const unmarshalOSSupportedServerType = (data: unknown): OSSupportedServerType => { +const unmarshalOSSupportedServerType = ( + data: unknown, +): OSSupportedServerType => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OSSupportedServerType' failed as data isn't a dictionary.`, @@ -66,7 +73,9 @@ export const unmarshalOS = (data: unknown): OS => { } return { - compatibleServerTypes: data.compatible_server_types ? data.compatible_server_types : undefined, + compatibleServerTypes: data.compatible_server_types + ? data.compatible_server_types + : undefined, description: data.description, family: data.family, id: data.id, @@ -75,7 +84,10 @@ export const unmarshalOS = (data: unknown): OS => { label: data.label, name: data.name, releaseNotesUrl: data.release_notes_url, - supportedServerTypes: unmarshalArrayOfObject(data.supported_server_types, unmarshalOSSupportedServerType), + supportedServerTypes: unmarshalArrayOfObject( + data.supported_server_types, + unmarshalOSSupportedServerType, + ), tags: data.tags, version: data.version, xcodeVersion: data.xcode_version, @@ -119,7 +131,9 @@ export const unmarshalServer = (data: unknown): Server => { return { appliedRunnerConfigurationIds: data.applied_runner_configuration_ids, - commitment: data.commitment ? unmarshalCommitment(data.commitment) : undefined, + commitment: data.commitment + ? unmarshalCommitment(data.commitment) + : undefined, createdAt: unmarshalDate(data.created_at), deletableAt: unmarshalDate(data.deletable_at), deletionScheduled: data.deletion_scheduled, @@ -131,7 +145,9 @@ export const unmarshalServer = (data: unknown): Server => { os: data.os ? unmarshalOS(data.os) : undefined, projectId: data.project_id, publicBandwidthBps: data.public_bandwidth_bps, - runnerConfiguration: data.runner_configuration ? unmarshalRunnerConfiguration(data.runner_configuration) : undefined, + runnerConfiguration: data.runner_configuration + ? unmarshalRunnerConfiguration(data.runner_configuration) + : undefined, sshUsername: data.ssh_username, status: data.status, sudoPassword: data.sudo_password, @@ -145,7 +161,9 @@ export const unmarshalServer = (data: unknown): Server => { } as Server } -const unmarshalGithubRunnerConfiguration = (data: unknown): GithubRunnerConfiguration => { +const unmarshalGithubRunnerConfiguration = ( + data: unknown, +): GithubRunnerConfiguration => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GithubRunnerConfiguration' failed as data isn't a dictionary.`, @@ -159,7 +177,9 @@ const unmarshalGithubRunnerConfiguration = (data: unknown): GithubRunnerConfigur } as GithubRunnerConfiguration } -const unmarshalGitlabRunnerConfiguration = (data: unknown): GitlabRunnerConfiguration => { +const unmarshalGitlabRunnerConfiguration = ( + data: unknown, +): GitlabRunnerConfiguration => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GitlabRunnerConfiguration' failed as data isn't a dictionary.`, @@ -172,7 +192,9 @@ const unmarshalGitlabRunnerConfiguration = (data: unknown): GitlabRunnerConfigur } as GitlabRunnerConfiguration } -const unmarshalRunnerConfigurationV2 = (data: unknown): RunnerConfigurationV2 => { +const unmarshalRunnerConfigurationV2 = ( + data: unknown, +): RunnerConfigurationV2 => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RunnerConfigurationV2' failed as data isn't a dictionary.`, @@ -180,8 +202,12 @@ const unmarshalRunnerConfigurationV2 = (data: unknown): RunnerConfigurationV2 => } return { - githubConfiguration: data.github_configuration ? unmarshalGithubRunnerConfiguration(data.github_configuration) : undefined, - gitlabConfiguration: data.gitlab_configuration ? unmarshalGitlabRunnerConfiguration(data.gitlab_configuration) : undefined, + githubConfiguration: data.github_configuration + ? unmarshalGithubRunnerConfiguration(data.github_configuration) + : undefined, + gitlabConfiguration: data.gitlab_configuration + ? unmarshalGitlabRunnerConfiguration(data.gitlab_configuration) + : undefined, name: data.name, provider: data.provider, } as RunnerConfigurationV2 @@ -195,14 +221,18 @@ export const unmarshalRunner = (data: unknown): Runner => { } return { - configuration: data.configuration ? unmarshalRunnerConfigurationV2(data.configuration) : undefined, + configuration: data.configuration + ? unmarshalRunnerConfigurationV2(data.configuration) + : undefined, errorMessage: data.error_message, id: data.id, status: data.status, } as Runner } -export const unmarshalServerPrivateNetwork = (data: unknown): ServerPrivateNetwork => { +export const unmarshalServerPrivateNetwork = ( + data: unknown, +): ServerPrivateNetwork => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`, @@ -317,13 +347,17 @@ export const unmarshalServerType = (data: unknown): ServerType => { memory: data.memory ? unmarshalServerTypeMemory(data.memory) : undefined, minimumLeaseDuration: data.minimum_lease_duration, name: data.name, - network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, + network: data.network + ? unmarshalServerTypeNetwork(data.network) + : undefined, npu: data.npu ? unmarshalServerTypeNPU(data.npu) : undefined, stock: data.stock, } as ServerType } -export const unmarshalBatchCreateServersResponse = (data: unknown): BatchCreateServersResponse => { +export const unmarshalBatchCreateServersResponse = ( + data: unknown, +): BatchCreateServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BatchCreateServersResponse' failed as data isn't a dictionary.`, @@ -335,7 +369,9 @@ export const unmarshalBatchCreateServersResponse = (data: unknown): BatchCreateS } as BatchCreateServersResponse } -const unmarshalConnectivityDiagnosticServerHealth = (data: unknown): ConnectivityDiagnosticServerHealth => { +const unmarshalConnectivityDiagnosticServerHealth = ( + data: unknown, +): ConnectivityDiagnosticServerHealth => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectivityDiagnosticServerHealth' failed as data isn't a dictionary.`, @@ -352,7 +388,9 @@ const unmarshalConnectivityDiagnosticServerHealth = (data: unknown): Connectivit } as ConnectivityDiagnosticServerHealth } -export const unmarshalConnectivityDiagnostic = (data: unknown): ConnectivityDiagnostic => { +export const unmarshalConnectivityDiagnostic = ( + data: unknown, +): ConnectivityDiagnostic => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectivityDiagnostic' failed as data isn't a dictionary.`, @@ -361,7 +399,9 @@ export const unmarshalConnectivityDiagnostic = (data: unknown): ConnectivityDiag return { errorMessage: data.error_message, - healthDetails: data.health_details ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) : undefined, + healthDetails: data.health_details + ? unmarshalConnectivityDiagnosticServerHealth(data.health_details) + : undefined, id: data.id, isHealthy: data.is_healthy, status: data.status, @@ -382,7 +422,9 @@ export const unmarshalListOSResponse = (data: unknown): ListOSResponse => { } as ListOSResponse } -export const unmarshalListRunnersResponse = (data: unknown): ListRunnersResponse => { +export const unmarshalListRunnersResponse = ( + data: unknown, +): ListRunnersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRunnersResponse' failed as data isn't a dictionary.`, @@ -395,7 +437,9 @@ export const unmarshalListRunnersResponse = (data: unknown): ListRunnersResponse } as ListRunnersResponse } -export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListServerPrivateNetworksResponse => { +export const unmarshalListServerPrivateNetworksResponse = ( + data: unknown, +): ListServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -403,12 +447,17 @@ export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListS } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), totalCount: data.total_count, } as ListServerPrivateNetworksResponse } -export const unmarshalListServerTypesResponse = (data: unknown): ListServerTypesResponse => { +export const unmarshalListServerTypesResponse = ( + data: unknown, +): ListServerTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary.`, @@ -420,7 +469,9 @@ export const unmarshalListServerTypesResponse = (data: unknown): ListServerTypes } as ListServerTypesResponse } -export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { +export const unmarshalListServersResponse = ( + data: unknown, +): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -433,7 +484,9 @@ export const unmarshalListServersResponse = (data: unknown): ListServersResponse } as ListServersResponse } -export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetServerPrivateNetworksResponse => { +export const unmarshalSetServerPrivateNetworksResponse = ( + data: unknown, +): SetServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -441,11 +494,16 @@ export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetSer } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), } as SetServerPrivateNetworksResponse } -export const unmarshalStartConnectivityDiagnosticResponse = (data: unknown): StartConnectivityDiagnosticResponse => { +export const unmarshalStartConnectivityDiagnosticResponse = ( + data: unknown, +): StartConnectivityDiagnosticResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'StartConnectivityDiagnosticResponse' failed as data isn't a dictionary.`, @@ -473,7 +531,15 @@ export const marshalBatchCreateServersRequest = ( os_id: request.osId, project_id: request.projectId ?? defaults.defaultProjectId, public_bandwidth_bps: request.publicBandwidthBps, - requests: ((request.requests !== undefined) ? request.requests.map(elt => marshalBatchCreateServersRequestBatchInnerCreateServerRequest(elt, defaults)): undefined), + requests: + request.requests !== undefined + ? request.requests.map(elt => + marshalBatchCreateServersRequestBatchInnerCreateServerRequest( + elt, + defaults, + ), + ) + : undefined, type: request.type, }) @@ -499,15 +565,27 @@ const marshalRunnerConfigurationV2 = ( defaults: DefaultValues, ): Record => ({ name: request.name, - provider: request.provider, + provider: request.provider, ...resolveOneOf([ - {param: 'github_configuration', - value: (request.githubConfiguration !== undefined) ? marshalGithubRunnerConfiguration(request.githubConfiguration, defaults) - : undefined, + { + param: 'github_configuration', + value: + request.githubConfiguration !== undefined + ? marshalGithubRunnerConfiguration( + request.githubConfiguration, + defaults, + ) + : undefined, }, - {param: 'gitlab_configuration', - value: (request.gitlabConfiguration !== undefined) ? marshalGitlabRunnerConfiguration(request.gitlabConfiguration, defaults) - : undefined, + { + param: 'gitlab_configuration', + value: + request.gitlabConfiguration !== undefined + ? marshalGitlabRunnerConfiguration( + request.gitlabConfiguration, + defaults, + ) + : undefined, }, ]), }) @@ -517,7 +595,10 @@ export const marshalCreateRunnerRequest = ( defaults: DefaultValues, ): Record => ({ project_id: request.projectId ?? defaults.defaultProjectId, - runner_configuration: marshalRunnerConfigurationV2(request.runnerConfiguration, defaults), + runner_configuration: marshalRunnerConfigurationV2( + request.runnerConfiguration, + defaults, + ), }) const marshalAppliedRunnerConfigurations = ( @@ -541,14 +622,23 @@ export const marshalCreateServerRequest = ( request: CreateServerRequest, defaults: DefaultValues, ): Record => ({ - applied_runner_configurations: ((request.appliedRunnerConfigurations !== undefined) ? marshalAppliedRunnerConfigurations(request.appliedRunnerConfigurations, defaults): undefined), + applied_runner_configurations: + request.appliedRunnerConfigurations !== undefined + ? marshalAppliedRunnerConfigurations( + request.appliedRunnerConfigurations, + defaults, + ) + : undefined, commitment_type: request.commitmentType, enable_vpc: request.enableVpc, name: request.name || randomName('as'), os_id: request.osId, project_id: request.projectId ?? defaults.defaultProjectId, public_bandwidth_bps: request.publicBandwidthBps, - runner_configuration: ((request.runnerConfiguration !== undefined) ? marshalRunnerConfiguration(request.runnerConfiguration, defaults): undefined), + runner_configuration: + request.runnerConfiguration !== undefined + ? marshalRunnerConfiguration(request.runnerConfiguration, defaults) + : undefined, type: request.type, }) @@ -564,7 +654,7 @@ export const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = ( request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues, ): Record => ({ - per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, + per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, }) export const marshalReinstallServerRequest = ( @@ -585,7 +675,10 @@ export const marshalUpdateRunnerRequest = ( request: UpdateRunnerRequest, defaults: DefaultValues, ): Record => ({ - runner_configuration: marshalRunnerConfigurationV2(request.runnerConfiguration, defaults), + runner_configuration: marshalRunnerConfigurationV2( + request.runnerConfiguration, + defaults, + ), }) const marshalCommitmentTypeValue = ( @@ -599,8 +692,17 @@ export const marshalUpdateServerRequest = ( request: UpdateServerRequest, defaults: DefaultValues, ): Record => ({ - applied_runner_configurations: ((request.appliedRunnerConfigurations !== undefined) ? marshalAppliedRunnerConfigurations(request.appliedRunnerConfigurations, defaults): undefined), - commitment_type: ((request.commitmentType !== undefined) ? marshalCommitmentTypeValue(request.commitmentType, defaults): undefined), + applied_runner_configurations: + request.appliedRunnerConfigurations !== undefined + ? marshalAppliedRunnerConfigurations( + request.appliedRunnerConfigurations, + defaults, + ) + : undefined, + commitment_type: + request.commitmentType !== undefined + ? marshalCommitmentTypeValue(request.commitmentType, defaults) + : undefined, enable_vpc: request.enableVpc, name: request.name, public_bandwidth_bps: request.publicBandwidthBps, diff --git a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts index 9a24cbcd2..6d5797578 100644 --- a/packages_generated/applesilicon/src/v1alpha1/types.gen.ts +++ b/packages_generated/applesilicon/src/v1alpha1/types.gen.ts @@ -1,12 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' +import type { Zone as ScwZone } from '@scaleway/sdk-client' - -export type CommitmentType = - | 'duration_24h' - | 'renewed_monthly' - | 'none' +export type CommitmentType = 'duration_24h' | 'renewed_monthly' | 'none' export type ConnectivityDiagnosticActionType = | 'reboot_server' @@ -24,9 +20,7 @@ export type ListServerPrivateNetworksRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListServersRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type RunnerConfigurationProvider = | 'unknown_provider' @@ -83,26 +77,22 @@ export interface OSSupportedServerType { fastDeliveryAvailable: boolean } - export interface GithubRunnerConfiguration { url: string token: string labels: string[] } - export interface GitlabRunnerConfiguration { url: string token: string } - export interface Commitment { type: CommitmentType cancelled: boolean } - export interface OS { /** * Unique ID of the OS. @@ -158,7 +148,6 @@ export interface OS { supportedServerTypes: OSSupportedServerType[] } - export interface RunnerConfiguration { name: string url: string @@ -166,7 +155,6 @@ export interface RunnerConfiguration { provider: RunnerConfigurationProvider } - export interface RunnerConfigurationV2 { name: string provider: RunnerConfigurationV2Provider @@ -182,7 +170,6 @@ export interface RunnerConfigurationV2 { gitlabConfiguration?: GitlabRunnerConfiguration } - export interface ServerTypeCPU { name: string coreCount: number @@ -191,41 +178,34 @@ export interface ServerTypeCPU { threadsPerCore: number } - export interface ServerTypeDisk { capacity: number type: string } - export interface ServerTypeGPU { count: number } - export interface ServerTypeMemory { capacity: number type: string } - export interface ServerTypeNPU { count: number } - export interface ServerTypeNetwork { publicBandwidthBps: number supportedBandwidth: number[] defaultPublicBandwidth: number } - export interface BatchCreateServersRequestBatchInnerCreateServerRequest { name: string } - export interface Server { /** * UUID of the server. @@ -325,7 +305,6 @@ export interface Server { appliedRunnerConfigurationIds: string[] } - export interface ConnectivityDiagnosticServerHealth { lastCheckinDate?: Date isServerAlive: boolean @@ -335,12 +314,10 @@ export interface ConnectivityDiagnosticServerHealth { isVncPortUp: boolean } - export interface AppliedRunnerConfigurations { runnerConfigurationIds: string[] } - export interface Runner { id: string configuration?: RunnerConfigurationV2 @@ -348,7 +325,6 @@ export interface Runner { errorMessage: string } - export interface ServerPrivateNetwork { /** * ID of the Server-to-Private Network mapping. @@ -388,7 +364,6 @@ export interface ServerPrivateNetwork { ipamIpIds: string[] } - export interface ServerType { /** * CPU description. @@ -432,12 +407,10 @@ export interface ServerType { npu?: ServerTypeNPU } - export interface CommitmentTypeValue { commitmentType: CommitmentType } - export type BatchCreateServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -473,7 +446,6 @@ export type BatchCreateServersRequest = { requests?: BatchCreateServersRequestBatchInnerCreateServerRequest[] } - export interface BatchCreateServersResponse { /** * List of created servers. @@ -481,7 +453,6 @@ export interface BatchCreateServersResponse { servers: Server[] } - export interface ConnectivityDiagnostic { id: string status: ConnectivityDiagnosticDiagnosticStatus @@ -491,7 +462,6 @@ export interface ConnectivityDiagnostic { errorMessage: string } - export type CreateRunnerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -507,7 +477,6 @@ export type CreateRunnerRequest = { runnerConfiguration: RunnerConfigurationV2 } - export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -551,7 +520,6 @@ export type CreateServerRequest = { appliedRunnerConfigurations?: AppliedRunnerConfigurations } - export type DeleteRunnerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -563,7 +531,6 @@ export type DeleteRunnerRequest = { runnerId: string } - export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -575,7 +542,6 @@ export type DeleteServerRequest = { serverId: string } - export type GetConnectivityDiagnosticRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -584,7 +550,6 @@ export type GetConnectivityDiagnosticRequest = { diagnosticId: string } - export type GetOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -596,7 +561,6 @@ export type GetOSRequest = { osId: string } - export type GetRunnerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -608,7 +572,6 @@ export type GetRunnerRequest = { runnerId: string } - export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -620,7 +583,6 @@ export type GetServerRequest = { serverId: string } - export type GetServerTypeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -632,7 +594,6 @@ export type GetServerTypeRequest = { serverType: string } - export type ListOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -656,7 +617,6 @@ export type ListOSRequest = { name?: string } - export interface ListOSResponse { /** * Total number of OS. @@ -668,7 +628,6 @@ export interface ListOSResponse { os: OS[] } - export type ListRunnersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -696,19 +655,16 @@ export type ListRunnersRequest = { pageSize?: number } - export interface ListRunnersResponse { totalCount: number runners: Runner[] } - export interface ListServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] totalCount: number } - export type ListServerTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -716,7 +672,6 @@ export type ListServerTypesRequest = { zone?: ScwZone } - export interface ListServerTypesResponse { /** * Available server types. @@ -724,7 +679,6 @@ export interface ListServerTypesResponse { serverTypes: ServerType[] } - export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -752,7 +706,6 @@ export type ListServersRequest = { pageSize?: number } - export interface ListServersResponse { /** * Total number of servers. @@ -764,7 +717,6 @@ export interface ListServersResponse { servers: Server[] } - export type PrivateNetworkApiAddServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -784,7 +736,6 @@ export type PrivateNetworkApiAddServerPrivateNetworkRequest = { ipamIpIds?: string[] } - export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -800,7 +751,6 @@ export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { privateNetworkId: string } - export type PrivateNetworkApiGetServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -810,7 +760,6 @@ export type PrivateNetworkApiGetServerPrivateNetworkRequest = { privateNetworkId: string } - export type PrivateNetworkApiListServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -850,7 +799,6 @@ export type PrivateNetworkApiListServerPrivateNetworksRequest = { ipamIpIds?: string[] } - export type PrivateNetworkApiSetServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -866,7 +814,6 @@ export type PrivateNetworkApiSetServerPrivateNetworksRequest = { perPrivateNetworkIpamIpIds: Record } - export type RebootServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -878,7 +825,6 @@ export type RebootServerRequest = { serverId: string } - export type ReinstallServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -894,12 +840,10 @@ export type ReinstallServerRequest = { osId?: string } - export interface SetServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] } - export type StartConnectivityDiagnosticRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -908,12 +852,10 @@ export type StartConnectivityDiagnosticRequest = { serverId: string } - export interface StartConnectivityDiagnosticResponse { diagnosticId: string } - export type UpdateRunnerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -929,7 +871,6 @@ export type UpdateRunnerRequest = { runnerConfiguration: RunnerConfigurationV2 } - export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -964,5 +905,3 @@ export type UpdateServerRequest = { */ appliedRunnerConfigurations?: AppliedRunnerConfigurations } - - diff --git a/packages_generated/audit_trail/src/v1alpha1/api.gen.ts b/packages_generated/audit_trail/src/v1alpha1/api.gen.ts index ee6057d66..127defcf8 100644 --- a/packages_generated/audit_trail/src/v1alpha1/api.gen.ts +++ b/packages_generated/audit_trail/src/v1alpha1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalCreateExportJobRequest, unmarshalExportJob, @@ -47,14 +47,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams'], + }) + /** * List events. Retrieve the list of Audit Trail events for a Scaleway Organization and/or Project. You must specify the `organization_id` and optionally, the `project_id`. * @@ -69,8 +65,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['method_name', request.methodName], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['page_token', request.pageToken], ['principal_id', request.principalId], ['product_name', request.productName], @@ -87,22 +90,30 @@ export class API extends ParentAPI { unmarshalListEventsResponse, ) - /** * List authentication events. Retrieve the list of Audit Trail authentication events for a Scaleway Organization. You must specify the `organization_id`. * * @param request - The request {@link ListAuthenticationEventsRequest} * @returns A Promise of ListAuthenticationEventsResponse */ - listAuthenticationEvents = (request: Readonly = {}) => + listAuthenticationEvents = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/authentication-events`, urlParams: urlParams( ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['page_token', request.pageToken], ['recorded_after', request.recordedAfter], ['recorded_before', request.recordedBefore], @@ -111,7 +122,6 @@ export class API extends ParentAPI { unmarshalListAuthenticationEventsResponse, ) - listCombinedEvents = (request: Readonly = {}) => this.client.fetch( { @@ -119,8 +129,15 @@ export class API extends ParentAPI { path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/combined-events`, urlParams: urlParams( ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['page_token', request.pageToken], ['project_id', request.projectId], ['recorded_after', request.recordedAfter], @@ -131,7 +148,6 @@ export class API extends ParentAPI { unmarshalListCombinedEventsResponse, ) - /** * Retrieve the list of Scaleway resources for which you have Audit Trail events. * @@ -143,14 +159,14 @@ export class API extends ParentAPI { { method: 'GET', path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`, - urlParams: urlParams( - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ), + urlParams: urlParams([ + 'organization_id', + request.organizationId ?? this.client.settings.defaultOrganizationId, + ]), }, unmarshalListProductsResponse, ) - /** * Create an export job. Create an export job for a specified organization. This allows you to export audit trail events to a destination, such as an S3 bucket. The request requires the organization ID, a name for the export, and a destination configuration. * @@ -170,22 +186,20 @@ export class API extends ParentAPI { unmarshalExportJob, ) - /** * Delete an export job. Deletes an export job for a specified id. * * @param request - The request {@link DeleteExportJobRequest} */ deleteExportJob = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/export-jobs/${validatePathParam('exportJobId', request.exportJobId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/export-jobs/${validatePathParam('exportJobId', request.exportJobId)}`, + }) - - protected pageOfListExportJobs = (request: Readonly = {}) => + protected pageOfListExportJobs = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -193,18 +207,22 @@ export class API extends ParentAPI { urlParams: urlParams( ['name', request.name], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['tags', request.tags], ), }, unmarshalListExportJobsResponse, ) - + listExportJobs = (request: Readonly = {}) => enrichForPagination('exportJobs', this.pageOfListExportJobs, request) - - } - diff --git a/packages_generated/audit_trail/src/v1alpha1/index.gen.ts b/packages_generated/audit_trail/src/v1alpha1/index.gen.ts index 772c6fcb9..fa14d85b9 100644 --- a/packages_generated/audit_trail/src/v1alpha1/index.gen.ts +++ b/packages_generated/audit_trail/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { AccountContractSignatureInfo, diff --git a/packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts b/packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts index e78459285..60aa6669d 100644 --- a/packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/audit_trail/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ExportJobS3, @@ -93,7 +97,9 @@ export const unmarshalExportJob = (data: unknown): ExportJob => { createdAt: unmarshalDate(data.created_at), id: data.id, lastRunAt: unmarshalDate(data.last_run_at), - lastStatus: data.last_status ? unmarshalExportJobStatus(data.last_status) : undefined, + lastStatus: data.last_status + ? unmarshalExportJobStatus(data.last_status) + : undefined, name: data.name, organizationId: data.organization_id, s3: data.s3 ? unmarshalExportJobS3(data.s3) : undefined, @@ -101,7 +107,9 @@ export const unmarshalExportJob = (data: unknown): ExportJob => { } as ExportJob } -const unmarshalAccountContractSignatureInfoAccountContractInfo = (data: unknown): AccountContractSignatureInfoAccountContractInfo => { +const unmarshalAccountContractSignatureInfoAccountContractInfo = ( + data: unknown, +): AccountContractSignatureInfoAccountContractInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AccountContractSignatureInfoAccountContractInfo' failed as data isn't a dictionary.`, @@ -118,7 +126,9 @@ const unmarshalAccountContractSignatureInfoAccountContractInfo = (data: unknown) } as AccountContractSignatureInfoAccountContractInfo } -const unmarshalAccountContractSignatureInfo = (data: unknown): AccountContractSignatureInfo => { +const unmarshalAccountContractSignatureInfo = ( + data: unknown, +): AccountContractSignatureInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AccountContractSignatureInfo' failed as data isn't a dictionary.`, @@ -126,22 +136,25 @@ const unmarshalAccountContractSignatureInfo = (data: unknown): AccountContractSi } return { - contract: data.contract ? unmarshalAccountContractSignatureInfoAccountContractInfo(data.contract) : undefined, + contract: data.contract + ? unmarshalAccountContractSignatureInfoAccountContractInfo(data.contract) + : undefined, expiresAt: unmarshalDate(data.expires_at), signedAt: unmarshalDate(data.signed_at), signedByAccountRootUserId: data.signed_by_account_root_user_id, } as AccountContractSignatureInfo } -const unmarshalAccountOrganizationInfo = (data: unknown): AccountOrganizationInfo => { +const unmarshalAccountOrganizationInfo = ( + data: unknown, +): AccountOrganizationInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AccountOrganizationInfo' failed as data isn't a dictionary.`, ) } - return { - } as AccountOrganizationInfo + return {} as AccountOrganizationInfo } const unmarshalAccountProjectInfo = (data: unknown): AccountProjectInfo => { @@ -169,7 +182,9 @@ const unmarshalAccountUserInfo = (data: unknown): AccountUserInfo => { } as AccountUserInfo } -const unmarshalAppleSiliconServerInfo = (data: unknown): AppleSiliconServerInfo => { +const unmarshalAppleSiliconServerInfo = ( + data: unknown, +): AppleSiliconServerInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AppleSiliconServerInfo' failed as data isn't a dictionary.`, @@ -207,7 +222,9 @@ const unmarshalBaremetalSettingInfo = (data: unknown): BaremetalSettingInfo => { } as BaremetalSettingInfo } -const unmarshalEdgeServicesBackendStageInfo = (data: unknown): EdgeServicesBackendStageInfo => { +const unmarshalEdgeServicesBackendStageInfo = ( + data: unknown, +): EdgeServicesBackendStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesBackendStageInfo' failed as data isn't a dictionary.`, @@ -219,7 +236,9 @@ const unmarshalEdgeServicesBackendStageInfo = (data: unknown): EdgeServicesBacke } as EdgeServicesBackendStageInfo } -const unmarshalEdgeServicesCacheStageInfo = (data: unknown): EdgeServicesCacheStageInfo => { +const unmarshalEdgeServicesCacheStageInfo = ( + data: unknown, +): EdgeServicesCacheStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesCacheStageInfo' failed as data isn't a dictionary.`, @@ -231,7 +250,9 @@ const unmarshalEdgeServicesCacheStageInfo = (data: unknown): EdgeServicesCacheSt } as EdgeServicesCacheStageInfo } -const unmarshalEdgeServicesDNSStageInfo = (data: unknown): EdgeServicesDNSStageInfo => { +const unmarshalEdgeServicesDNSStageInfo = ( + data: unknown, +): EdgeServicesDNSStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesDNSStageInfo' failed as data isn't a dictionary.`, @@ -243,7 +264,9 @@ const unmarshalEdgeServicesDNSStageInfo = (data: unknown): EdgeServicesDNSStageI } as EdgeServicesDNSStageInfo } -const unmarshalEdgeServicesPipelineInfo = (data: unknown): EdgeServicesPipelineInfo => { +const unmarshalEdgeServicesPipelineInfo = ( + data: unknown, +): EdgeServicesPipelineInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesPipelineInfo' failed as data isn't a dictionary.`, @@ -262,11 +285,12 @@ const unmarshalEdgeServicesPlanInfo = (data: unknown): EdgeServicesPlanInfo => { ) } - return { - } as EdgeServicesPlanInfo + return {} as EdgeServicesPlanInfo } -const unmarshalEdgeServicesRouteRulesInfo = (data: unknown): EdgeServicesRouteRulesInfo => { +const unmarshalEdgeServicesRouteRulesInfo = ( + data: unknown, +): EdgeServicesRouteRulesInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesRouteRulesInfo' failed as data isn't a dictionary.`, @@ -278,7 +302,9 @@ const unmarshalEdgeServicesRouteRulesInfo = (data: unknown): EdgeServicesRouteRu } as EdgeServicesRouteRulesInfo } -const unmarshalEdgeServicesRouteStageInfo = (data: unknown): EdgeServicesRouteStageInfo => { +const unmarshalEdgeServicesRouteStageInfo = ( + data: unknown, +): EdgeServicesRouteStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesRouteStageInfo' failed as data isn't a dictionary.`, @@ -290,7 +316,9 @@ const unmarshalEdgeServicesRouteStageInfo = (data: unknown): EdgeServicesRouteSt } as EdgeServicesRouteStageInfo } -const unmarshalEdgeServicesTLSStageInfo = (data: unknown): EdgeServicesTLSStageInfo => { +const unmarshalEdgeServicesTLSStageInfo = ( + data: unknown, +): EdgeServicesTLSStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesTLSStageInfo' failed as data isn't a dictionary.`, @@ -302,7 +330,9 @@ const unmarshalEdgeServicesTLSStageInfo = (data: unknown): EdgeServicesTLSStageI } as EdgeServicesTLSStageInfo } -const unmarshalEdgeServicesWAFStageInfo = (data: unknown): EdgeServicesWAFStageInfo => { +const unmarshalEdgeServicesWAFStageInfo = ( + data: unknown, +): EdgeServicesWAFStageInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EdgeServicesWAFStageInfo' failed as data isn't a dictionary.`, @@ -345,8 +375,7 @@ const unmarshalKeyManagerKeyInfo = (data: unknown): KeyManagerKeyInfo => { ) } - return { - } as KeyManagerKeyInfo + return {} as KeyManagerKeyInfo } const unmarshalKubernetesACLInfo = (data: unknown): KubernetesACLInfo => { @@ -356,19 +385,19 @@ const unmarshalKubernetesACLInfo = (data: unknown): KubernetesACLInfo => { ) } - return { - } as KubernetesACLInfo + return {} as KubernetesACLInfo } -const unmarshalKubernetesClusterInfo = (data: unknown): KubernetesClusterInfo => { +const unmarshalKubernetesClusterInfo = ( + data: unknown, +): KubernetesClusterInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'KubernetesClusterInfo' failed as data isn't a dictionary.`, ) } - return { - } as KubernetesClusterInfo + return {} as KubernetesClusterInfo } const unmarshalKubernetesNodeInfo = (data: unknown): KubernetesNodeInfo => { @@ -409,7 +438,9 @@ const unmarshalLoadBalancerAclInfo = (data: unknown): LoadBalancerAclInfo => { } as LoadBalancerAclInfo } -const unmarshalLoadBalancerBackendInfo = (data: unknown): LoadBalancerBackendInfo => { +const unmarshalLoadBalancerBackendInfo = ( + data: unknown, +): LoadBalancerBackendInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'LoadBalancerBackendInfo' failed as data isn't a dictionary.`, @@ -422,7 +453,9 @@ const unmarshalLoadBalancerBackendInfo = (data: unknown): LoadBalancerBackendInf } as LoadBalancerBackendInfo } -const unmarshalLoadBalancerCertificateInfo = (data: unknown): LoadBalancerCertificateInfo => { +const unmarshalLoadBalancerCertificateInfo = ( + data: unknown, +): LoadBalancerCertificateInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'LoadBalancerCertificateInfo' failed as data isn't a dictionary.`, @@ -435,7 +468,9 @@ const unmarshalLoadBalancerCertificateInfo = (data: unknown): LoadBalancerCertif } as LoadBalancerCertificateInfo } -const unmarshalLoadBalancerFrontendInfo = (data: unknown): LoadBalancerFrontendInfo => { +const unmarshalLoadBalancerFrontendInfo = ( + data: unknown, +): LoadBalancerFrontendInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'LoadBalancerFrontendInfo' failed as data isn't a dictionary.`, @@ -473,7 +508,9 @@ const unmarshalLoadBalancerLbInfo = (data: unknown): LoadBalancerLbInfo => { } as LoadBalancerLbInfo } -const unmarshalLoadBalancerRouteInfo = (data: unknown): LoadBalancerRouteInfo => { +const unmarshalLoadBalancerRouteInfo = ( + data: unknown, +): LoadBalancerRouteInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'LoadBalancerRouteInfo' failed as data isn't a dictionary.`, @@ -486,7 +523,9 @@ const unmarshalLoadBalancerRouteInfo = (data: unknown): LoadBalancerRouteInfo => } as LoadBalancerRouteInfo } -const unmarshalSecretManagerSecretInfo = (data: unknown): SecretManagerSecretInfo => { +const unmarshalSecretManagerSecretInfo = ( + data: unknown, +): SecretManagerSecretInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SecretManagerSecretInfo' failed as data isn't a dictionary.`, @@ -499,7 +538,9 @@ const unmarshalSecretManagerSecretInfo = (data: unknown): SecretManagerSecretInf } as SecretManagerSecretInfo } -const unmarshalSecretManagerSecretVersionInfo = (data: unknown): SecretManagerSecretVersionInfo => { +const unmarshalSecretManagerSecretVersionInfo = ( + data: unknown, +): SecretManagerSecretVersionInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SecretManagerSecretVersionInfo' failed as data isn't a dictionary.`, @@ -519,45 +560,123 @@ export const unmarshalResource = (data: unknown): Resource => { } return { - accountContractSignatureInfo: data.account_contract_signature_info ? unmarshalAccountContractSignatureInfo(data.account_contract_signature_info) : undefined, - accountOrganizationInfo: data.account_organization_info ? unmarshalAccountOrganizationInfo(data.account_organization_info) : undefined, - accountProjectInfo: data.account_project_info ? unmarshalAccountProjectInfo(data.account_project_info) : undefined, - accountUserInfo: data.account_user_info ? unmarshalAccountUserInfo(data.account_user_info) : undefined, - appleSiliconServerInfo: data.apple_silicon_server_info ? unmarshalAppleSiliconServerInfo(data.apple_silicon_server_info) : undefined, - baremetalServerInfo: data.baremetal_server_info ? unmarshalBaremetalServerInfo(data.baremetal_server_info) : undefined, - baremetalSettingInfo: data.baremetal_setting_info ? unmarshalBaremetalSettingInfo(data.baremetal_setting_info) : undefined, + accountContractSignatureInfo: data.account_contract_signature_info + ? unmarshalAccountContractSignatureInfo( + data.account_contract_signature_info, + ) + : undefined, + accountOrganizationInfo: data.account_organization_info + ? unmarshalAccountOrganizationInfo(data.account_organization_info) + : undefined, + accountProjectInfo: data.account_project_info + ? unmarshalAccountProjectInfo(data.account_project_info) + : undefined, + accountUserInfo: data.account_user_info + ? unmarshalAccountUserInfo(data.account_user_info) + : undefined, + appleSiliconServerInfo: data.apple_silicon_server_info + ? unmarshalAppleSiliconServerInfo(data.apple_silicon_server_info) + : undefined, + baremetalServerInfo: data.baremetal_server_info + ? unmarshalBaremetalServerInfo(data.baremetal_server_info) + : undefined, + baremetalSettingInfo: data.baremetal_setting_info + ? unmarshalBaremetalSettingInfo(data.baremetal_setting_info) + : undefined, createdAt: unmarshalDate(data.created_at), deletedAt: unmarshalDate(data.deleted_at), - edgeServicesBackendStageInfo: data.edge_services_backend_stage_info ? unmarshalEdgeServicesBackendStageInfo(data.edge_services_backend_stage_info) : undefined, - edgeServicesCacheStageInfo: data.edge_services_cache_stage_info ? unmarshalEdgeServicesCacheStageInfo(data.edge_services_cache_stage_info) : undefined, - edgeServicesDnsStageInfo: data.edge_services_dns_stage_info ? unmarshalEdgeServicesDNSStageInfo(data.edge_services_dns_stage_info) : undefined, - edgeServicesPipelineInfo: data.edge_services_pipeline_info ? unmarshalEdgeServicesPipelineInfo(data.edge_services_pipeline_info) : undefined, - edgeServicesPlanInfo: data.edge_services_plan_info ? unmarshalEdgeServicesPlanInfo(data.edge_services_plan_info) : undefined, - edgeServicesRouteRulesInfo: data.edge_services_route_rules_info ? unmarshalEdgeServicesRouteRulesInfo(data.edge_services_route_rules_info) : undefined, - edgeServicesRouteStageInfo: data.edge_services_route_stage_info ? unmarshalEdgeServicesRouteStageInfo(data.edge_services_route_stage_info) : undefined, - edgeServicesTlsStageInfo: data.edge_services_tls_stage_info ? unmarshalEdgeServicesTLSStageInfo(data.edge_services_tls_stage_info) : undefined, - edgeServicesWafStageInfo: data.edge_services_waf_stage_info ? unmarshalEdgeServicesWAFStageInfo(data.edge_services_waf_stage_info) : undefined, + edgeServicesBackendStageInfo: data.edge_services_backend_stage_info + ? unmarshalEdgeServicesBackendStageInfo( + data.edge_services_backend_stage_info, + ) + : undefined, + edgeServicesCacheStageInfo: data.edge_services_cache_stage_info + ? unmarshalEdgeServicesCacheStageInfo(data.edge_services_cache_stage_info) + : undefined, + edgeServicesDnsStageInfo: data.edge_services_dns_stage_info + ? unmarshalEdgeServicesDNSStageInfo(data.edge_services_dns_stage_info) + : undefined, + edgeServicesPipelineInfo: data.edge_services_pipeline_info + ? unmarshalEdgeServicesPipelineInfo(data.edge_services_pipeline_info) + : undefined, + edgeServicesPlanInfo: data.edge_services_plan_info + ? unmarshalEdgeServicesPlanInfo(data.edge_services_plan_info) + : undefined, + edgeServicesRouteRulesInfo: data.edge_services_route_rules_info + ? unmarshalEdgeServicesRouteRulesInfo(data.edge_services_route_rules_info) + : undefined, + edgeServicesRouteStageInfo: data.edge_services_route_stage_info + ? unmarshalEdgeServicesRouteStageInfo(data.edge_services_route_stage_info) + : undefined, + edgeServicesTlsStageInfo: data.edge_services_tls_stage_info + ? unmarshalEdgeServicesTLSStageInfo(data.edge_services_tls_stage_info) + : undefined, + edgeServicesWafStageInfo: data.edge_services_waf_stage_info + ? unmarshalEdgeServicesWAFStageInfo(data.edge_services_waf_stage_info) + : undefined, id: data.id, - instanceServerInfo: data.instance_server_info ? unmarshalInstanceServerInfo(data.instance_server_info) : undefined, - ipamIpInfo: data.ipam_ip_info ? unmarshalIpamIpInfo(data.ipam_ip_info) : undefined, - keyManagerKeyInfo: data.key_manager_key_info ? unmarshalKeyManagerKeyInfo(data.key_manager_key_info) : undefined, - keymKeyInfo: data.keym_key_info ? unmarshalKeyManagerKeyInfo(data.keym_key_info) : undefined, - kubeAclInfo: data.kube_acl_info ? unmarshalKubernetesACLInfo(data.kube_acl_info) : undefined, - kubeClusterInfo: data.kube_cluster_info ? unmarshalKubernetesClusterInfo(data.kube_cluster_info) : undefined, - kubeNodeInfo: data.kube_node_info ? unmarshalKubernetesNodeInfo(data.kube_node_info) : undefined, - kubePoolInfo: data.kube_pool_info ? unmarshalKubernetesPoolInfo(data.kube_pool_info) : undefined, - loadBalancerAclInfo: data.load_balancer_acl_info ? unmarshalLoadBalancerAclInfo(data.load_balancer_acl_info) : undefined, - loadBalancerBackendInfo: data.load_balancer_backend_info ? unmarshalLoadBalancerBackendInfo(data.load_balancer_backend_info) : undefined, - loadBalancerCertificateInfo: data.load_balancer_certificate_info ? unmarshalLoadBalancerCertificateInfo(data.load_balancer_certificate_info) : undefined, - loadBalancerFrontendInfo: data.load_balancer_frontend_info ? unmarshalLoadBalancerFrontendInfo(data.load_balancer_frontend_info) : undefined, - loadBalancerIpInfo: data.load_balancer_ip_info ? unmarshalLoadBalancerIpInfo(data.load_balancer_ip_info) : undefined, - loadBalancerLbInfo: data.load_balancer_lb_info ? unmarshalLoadBalancerLbInfo(data.load_balancer_lb_info) : undefined, - loadBalancerRouteInfo: data.load_balancer_route_info ? unmarshalLoadBalancerRouteInfo(data.load_balancer_route_info) : undefined, + instanceServerInfo: data.instance_server_info + ? unmarshalInstanceServerInfo(data.instance_server_info) + : undefined, + ipamIpInfo: data.ipam_ip_info + ? unmarshalIpamIpInfo(data.ipam_ip_info) + : undefined, + keyManagerKeyInfo: data.key_manager_key_info + ? unmarshalKeyManagerKeyInfo(data.key_manager_key_info) + : undefined, + keymKeyInfo: data.keym_key_info + ? unmarshalKeyManagerKeyInfo(data.keym_key_info) + : undefined, + kubeAclInfo: data.kube_acl_info + ? unmarshalKubernetesACLInfo(data.kube_acl_info) + : undefined, + kubeClusterInfo: data.kube_cluster_info + ? unmarshalKubernetesClusterInfo(data.kube_cluster_info) + : undefined, + kubeNodeInfo: data.kube_node_info + ? unmarshalKubernetesNodeInfo(data.kube_node_info) + : undefined, + kubePoolInfo: data.kube_pool_info + ? unmarshalKubernetesPoolInfo(data.kube_pool_info) + : undefined, + loadBalancerAclInfo: data.load_balancer_acl_info + ? unmarshalLoadBalancerAclInfo(data.load_balancer_acl_info) + : undefined, + loadBalancerBackendInfo: data.load_balancer_backend_info + ? unmarshalLoadBalancerBackendInfo(data.load_balancer_backend_info) + : undefined, + loadBalancerCertificateInfo: data.load_balancer_certificate_info + ? unmarshalLoadBalancerCertificateInfo( + data.load_balancer_certificate_info, + ) + : undefined, + loadBalancerFrontendInfo: data.load_balancer_frontend_info + ? unmarshalLoadBalancerFrontendInfo(data.load_balancer_frontend_info) + : undefined, + loadBalancerIpInfo: data.load_balancer_ip_info + ? unmarshalLoadBalancerIpInfo(data.load_balancer_ip_info) + : undefined, + loadBalancerLbInfo: data.load_balancer_lb_info + ? unmarshalLoadBalancerLbInfo(data.load_balancer_lb_info) + : undefined, + loadBalancerRouteInfo: data.load_balancer_route_info + ? unmarshalLoadBalancerRouteInfo(data.load_balancer_route_info) + : undefined, name: data.name, - secmSecretInfo: data.secm_secret_info ? unmarshalSecretManagerSecretInfo(data.secm_secret_info) : undefined, - secmSecretVersionInfo: data.secm_secret_version_info ? unmarshalSecretManagerSecretVersionInfo(data.secm_secret_version_info) : undefined, - secretManagerSecretInfo: data.secret_manager_secret_info ? unmarshalSecretManagerSecretInfo(data.secret_manager_secret_info) : undefined, - secretManagerVersionInfo: data.secret_manager_version_info ? unmarshalSecretManagerSecretVersionInfo(data.secret_manager_version_info) : undefined, + secmSecretInfo: data.secm_secret_info + ? unmarshalSecretManagerSecretInfo(data.secm_secret_info) + : undefined, + secmSecretVersionInfo: data.secm_secret_version_info + ? unmarshalSecretManagerSecretVersionInfo(data.secm_secret_version_info) + : undefined, + secretManagerSecretInfo: data.secret_manager_secret_info + ? unmarshalSecretManagerSecretInfo(data.secret_manager_secret_info) + : undefined, + secretManagerVersionInfo: data.secret_manager_version_info + ? unmarshalSecretManagerSecretVersionInfo( + data.secret_manager_version_info, + ) + : undefined, type: data.type, updatedAt: unmarshalDate(data.updated_at), } as Resource @@ -586,7 +705,9 @@ const unmarshalAuthenticationEvent = (data: unknown): AuthenticationEvent => { } as AuthenticationEvent } -export const unmarshalListAuthenticationEventsResponse = (data: unknown): ListAuthenticationEventsResponse => { +export const unmarshalListAuthenticationEventsResponse = ( + data: unknown, +): ListAuthenticationEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAuthenticationEventsResponse' failed as data isn't a dictionary.`, @@ -623,7 +744,9 @@ export const unmarshalEvent = (data: unknown): Event => { locality: data.locality, methodName: data.method_name, organizationId: data.organization_id, - principal: data.principal ? unmarshalEventPrincipal(data.principal) : undefined, + principal: data.principal + ? unmarshalEventPrincipal(data.principal) + : undefined, productName: data.product_name, projectId: data.project_id, recordedAt: unmarshalDate(data.recorded_at), @@ -658,7 +781,9 @@ const unmarshalSystemEvent = (data: unknown): SystemEvent => { } as SystemEvent } -const unmarshalListCombinedEventsResponseCombinedEvent = (data: unknown): ListCombinedEventsResponseCombinedEvent => { +const unmarshalListCombinedEventsResponseCombinedEvent = ( + data: unknown, +): ListCombinedEventsResponseCombinedEvent => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCombinedEventsResponseCombinedEvent' failed as data isn't a dictionary.`, @@ -672,7 +797,9 @@ const unmarshalListCombinedEventsResponseCombinedEvent = (data: unknown): ListCo } as ListCombinedEventsResponseCombinedEvent } -export const unmarshalListCombinedEventsResponse = (data: unknown): ListCombinedEventsResponse => { +export const unmarshalListCombinedEventsResponse = ( + data: unknown, +): ListCombinedEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCombinedEventsResponse' failed as data isn't a dictionary.`, @@ -680,12 +807,17 @@ export const unmarshalListCombinedEventsResponse = (data: unknown): ListCombined } return { - events: unmarshalArrayOfObject(data.events, unmarshalListCombinedEventsResponseCombinedEvent), + events: unmarshalArrayOfObject( + data.events, + unmarshalListCombinedEventsResponseCombinedEvent, + ), nextPageToken: data.next_page_token, } as ListCombinedEventsResponse } -export const unmarshalListEventsResponse = (data: unknown): ListEventsResponse => { +export const unmarshalListEventsResponse = ( + data: unknown, +): ListEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListEventsResponse' failed as data isn't a dictionary.`, @@ -698,7 +830,9 @@ export const unmarshalListEventsResponse = (data: unknown): ListEventsResponse = } as ListEventsResponse } -export const unmarshalListExportJobsResponse = (data: unknown): ListExportJobsResponse => { +export const unmarshalListExportJobsResponse = ( + data: unknown, +): ListExportJobsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListExportJobsResponse' failed as data isn't a dictionary.`, @@ -738,7 +872,9 @@ const unmarshalProduct = (data: unknown): Product => { } as Product } -export const unmarshalListProductsResponse = (data: unknown): ListProductsResponse => { +export const unmarshalListProductsResponse = ( + data: unknown, +): ListProductsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`, @@ -767,11 +903,14 @@ export const marshalCreateExportJobRequest = ( ): Record => ({ name: request.name, organization_id: request.organizationId ?? defaults.defaultOrganizationId, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {param: 's3', - value: (request.s3 !== undefined) ? marshalExportJobS3(request.s3, defaults) - : undefined, + { + param: 's3', + value: + request.s3 !== undefined + ? marshalExportJobS3(request.s3, defaults) + : undefined, }, ]), }) diff --git a/packages_generated/audit_trail/src/v1alpha1/types.gen.ts b/packages_generated/audit_trail/src/v1alpha1/types.gen.ts index 690371288..2449ee662 100644 --- a/packages_generated/audit_trail/src/v1alpha1/types.gen.ts +++ b/packages_generated/audit_trail/src/v1alpha1/types.gen.ts @@ -1,17 +1,14 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' -import type {CountryCode as StdCountryCode,} from '@scaleway/sdk-std' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' +import type { CountryCode as StdCountryCode } from '@scaleway/sdk-std' export type AuthenticationEventFailureReason = | 'unknown_failure_reason' | 'invalid_mfa' | 'invalid_password' -export type AuthenticationEventMFAType = - | 'unknown_mfa_type' - | 'totp' +export type AuthenticationEventMFAType = 'unknown_mfa_type' | 'totp' export type AuthenticationEventMethod = | 'unknown_method' @@ -25,15 +22,9 @@ export type AuthenticationEventOrigin = | 'public_api' | 'admin_api' -export type AuthenticationEventResult = - | 'unknown_result' - | 'success' - | 'failure' +export type AuthenticationEventResult = 'unknown_result' | 'success' | 'failure' -export type ExportJobStatusCode = - | 'unknown_code' - | 'success' - | 'failure' +export type ExportJobStatusCode = 'unknown_code' | 'success' | 'failure' export type ListAuthenticationEventsRequestOrderBy = | 'recorded_at_desc' @@ -43,9 +34,7 @@ export type ListCombinedEventsRequestOrderBy = | 'recorded_at_desc' | 'recorded_at_asc' -export type ListEventsRequestOrderBy = - | 'recorded_at_desc' - | 'recorded_at_asc' +export type ListEventsRequestOrderBy = 'recorded_at_desc' | 'recorded_at_asc' export type ListExportJobsRequestOrderBy = | 'name_asc' @@ -116,10 +105,7 @@ export type ResourceType = | 's2s_routing_policy' | 's2s_connection' -export type SystemEventKind = - | 'unknown_kind' - | 'cron' - | 'notification' +export type SystemEventKind = 'unknown_kind' | 'cron' | 'notification' export interface AccountContractSignatureInfoAccountContractInfo { id: string @@ -130,7 +116,6 @@ export interface AccountContractSignatureInfoAccountContractInfo { updatedAt?: Date } - export interface AccountContractSignatureInfo { signedAt?: Date signedByAccountRootUserId: string @@ -138,168 +123,131 @@ export interface AccountContractSignatureInfo { contract?: AccountContractSignatureInfoAccountContractInfo } - -export interface AccountOrganizationInfo { -} - +export interface AccountOrganizationInfo {} export interface AccountProjectInfo { description: string } - export interface AccountUserInfo { email: string phoneNumber?: string } - export interface AppleSiliconServerInfo { id: string name: string } - export interface BaremetalServerInfo { description: string tags: string[] } - export interface BaremetalSettingInfo { type: string } - export interface EdgeServicesBackendStageInfo { pipelineId?: string } - export interface EdgeServicesCacheStageInfo { pipelineId?: string } - export interface EdgeServicesDNSStageInfo { pipelineId?: string } - export interface EdgeServicesPipelineInfo { name: string } - -export interface EdgeServicesPlanInfo { -} - +export interface EdgeServicesPlanInfo {} export interface EdgeServicesRouteRulesInfo { routeStageId: string } - export interface EdgeServicesRouteStageInfo { pipelineId?: string } - export interface EdgeServicesTLSStageInfo { pipelineId?: string } - export interface EdgeServicesWAFStageInfo { pipelineId?: string } - export interface InstanceServerInfo { name: string } - export interface IpamIpInfo { address: string } +export interface KeyManagerKeyInfo {} -export interface KeyManagerKeyInfo { -} - - -export interface KubernetesACLInfo { -} - - -export interface KubernetesClusterInfo { -} +export interface KubernetesACLInfo {} +export interface KubernetesClusterInfo {} export interface KubernetesNodeInfo { id: string name: string } - export interface KubernetesPoolInfo { id: string name: string } - export interface LoadBalancerAclInfo { frontendId: string } - export interface LoadBalancerBackendInfo { lbId: string name: string } - export interface LoadBalancerCertificateInfo { lbId: string name: string } - export interface LoadBalancerFrontendInfo { lbId: string name: string } - export interface LoadBalancerIpInfo { ipAddress: string lbId?: string } - export interface LoadBalancerLbInfo { name: string } - export interface LoadBalancerRouteInfo { frontendId: string backendId: string } - export interface SecretManagerSecretInfo { path: string keyId?: string } - export interface SecretManagerSecretVersionInfo { revision: number } - export interface Resource { id: string type: ResourceType @@ -308,13 +256,13 @@ export interface Resource { deletedAt?: Date name?: string /** - * @deprecated + * @deprecated * * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo', 'appleSiliconServerInfo', 'accountProjectInfo', 'baremetalServerInfo', 'baremetalSettingInfo', 'ipamIpInfo', 'loadBalancerLbInfo', 'loadBalancerIpInfo', 'loadBalancerFrontendInfo', 'loadBalancerBackendInfo', 'loadBalancerRouteInfo', 'loadBalancerAclInfo', 'loadBalancerCertificateInfo', 'edgeServicesPlanInfo', 'edgeServicesPipelineInfo', 'edgeServicesDnsStageInfo', 'edgeServicesTlsStageInfo', 'edgeServicesCacheStageInfo', 'edgeServicesRouteStageInfo', 'edgeServicesRouteRulesInfo', 'edgeServicesWafStageInfo', 'edgeServicesBackendStageInfo', 'accountContractSignatureInfo' could be set. */ secmSecretInfo?: SecretManagerSecretInfo /** - * @deprecated + * @deprecated * * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo', 'appleSiliconServerInfo', 'accountProjectInfo', 'baremetalServerInfo', 'baremetalSettingInfo', 'ipamIpInfo', 'loadBalancerLbInfo', 'loadBalancerIpInfo', 'loadBalancerFrontendInfo', 'loadBalancerBackendInfo', 'loadBalancerRouteInfo', 'loadBalancerAclInfo', 'loadBalancerCertificateInfo', 'edgeServicesPlanInfo', 'edgeServicesPipelineInfo', 'edgeServicesDnsStageInfo', 'edgeServicesTlsStageInfo', 'edgeServicesCacheStageInfo', 'edgeServicesRouteStageInfo', 'edgeServicesRouteRulesInfo', 'edgeServicesWafStageInfo', 'edgeServicesBackendStageInfo', 'accountContractSignatureInfo' could be set. */ @@ -340,7 +288,7 @@ export interface Resource { */ kubeAclInfo?: KubernetesACLInfo /** - * @deprecated + * @deprecated * * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo', 'appleSiliconServerInfo', 'accountProjectInfo', 'baremetalServerInfo', 'baremetalSettingInfo', 'ipamIpInfo', 'loadBalancerLbInfo', 'loadBalancerIpInfo', 'loadBalancerFrontendInfo', 'loadBalancerBackendInfo', 'loadBalancerRouteInfo', 'loadBalancerAclInfo', 'loadBalancerCertificateInfo', 'edgeServicesPlanInfo', 'edgeServicesPipelineInfo', 'edgeServicesDnsStageInfo', 'edgeServicesTlsStageInfo', 'edgeServicesCacheStageInfo', 'edgeServicesRouteStageInfo', 'edgeServicesRouteRulesInfo', 'edgeServicesWafStageInfo', 'edgeServicesBackendStageInfo', 'accountContractSignatureInfo' could be set. */ @@ -371,7 +319,7 @@ export interface Resource { */ accountOrganizationInfo?: AccountOrganizationInfo /** - * @deprecated + * @deprecated * * One-of ('info'): at most one of 'secmSecretInfo', 'secmSecretVersionInfo', 'kubeClusterInfo', 'kubePoolInfo', 'kubeNodeInfo', 'kubeAclInfo', 'keymKeyInfo', 'secretManagerSecretInfo', 'secretManagerVersionInfo', 'keyManagerKeyInfo', 'accountUserInfo', 'accountOrganizationInfo', 'instanceServerInfo', 'appleSiliconServerInfo', 'accountProjectInfo', 'baremetalServerInfo', 'baremetalSettingInfo', 'ipamIpInfo', 'loadBalancerLbInfo', 'loadBalancerIpInfo', 'loadBalancerFrontendInfo', 'loadBalancerBackendInfo', 'loadBalancerRouteInfo', 'loadBalancerAclInfo', 'loadBalancerCertificateInfo', 'edgeServicesPlanInfo', 'edgeServicesPipelineInfo', 'edgeServicesDnsStageInfo', 'edgeServicesTlsStageInfo', 'edgeServicesCacheStageInfo', 'edgeServicesRouteStageInfo', 'edgeServicesRouteRulesInfo', 'edgeServicesWafStageInfo', 'edgeServicesBackendStageInfo', 'accountContractSignatureInfo' could be set. */ @@ -488,12 +436,10 @@ export interface Resource { accountContractSignatureInfo?: AccountContractSignatureInfo } - export interface EventPrincipal { id: string } - export interface AuthenticationEvent { /** * ID of the event. @@ -545,7 +491,6 @@ export interface AuthenticationEvent { mfaType?: AuthenticationEventMFAType } - export interface Event { /** * ID of the event. @@ -611,7 +556,6 @@ export interface Event { statusCode: number } - export interface SystemEvent { id: string recordedAt?: Date @@ -625,7 +569,6 @@ export interface SystemEvent { productName: string } - export interface ExportJobS3 { bucket: string /** @@ -636,19 +579,16 @@ export interface ExportJobS3 { projectId?: string } - export interface ExportJobStatus { code: ExportJobStatusCode message?: string } - export interface ProductService { name: string methods: string[] } - export interface ListCombinedEventsResponseCombinedEvent { /** * @@ -667,7 +607,6 @@ export interface ListCombinedEventsResponseCombinedEvent { system?: SystemEvent } - export interface ExportJob { /** * ID of the export job. @@ -705,7 +644,6 @@ export interface ExportJob { lastStatus?: ExportJobStatus } - export interface Product { /** * Product title. @@ -721,7 +659,6 @@ export interface Product { services: ProductService[] } - export type CreateExportJobRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -747,7 +684,6 @@ export type CreateExportJobRequest = { tags?: string[] } - export type DeleteExportJobRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -759,7 +695,6 @@ export type DeleteExportJobRequest = { exportJobId: string } - export type ListAuthenticationEventsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -773,13 +708,11 @@ export type ListAuthenticationEventsRequest = { pageToken?: string } - export interface ListAuthenticationEventsResponse { events: AuthenticationEvent[] nextPageToken?: string } - export type ListCombinedEventsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -795,13 +728,11 @@ export type ListCombinedEventsRequest = { pageToken?: string } - export interface ListCombinedEventsResponse { events: ListCombinedEventsResponseCombinedEvent[] nextPageToken?: string } - export type ListEventsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -860,7 +791,6 @@ export type ListEventsRequest = { sourceIp?: string } - export interface ListEventsResponse { /** * Single page of events matching the requested criteria. @@ -872,7 +802,6 @@ export interface ListEventsResponse { nextPageToken?: string } - export type ListExportJobsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -895,7 +824,6 @@ export type ListExportJobsRequest = { orderBy?: ListExportJobsRequestOrderBy } - export interface ListExportJobsResponse { /** * Single page of export jobs matching the requested criteria. @@ -907,7 +835,6 @@ export interface ListExportJobsResponse { totalCount: number } - export type ListProductsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -919,7 +846,6 @@ export type ListProductsRequest = { organizationId?: string } - export interface ListProductsResponse { /** * List of all products integrated with Audit Trail. @@ -930,5 +856,3 @@ export interface ListProductsResponse { */ totalCount: number } - - diff --git a/packages_generated/autoscaling/src/v1alpha1/api.gen.ts b/packages_generated/autoscaling/src/v1alpha1/api.gen.ts index 87616acdf..877813d42 100644 --- a/packages_generated/autoscaling/src/v1alpha1/api.gen.ts +++ b/packages_generated/autoscaling/src/v1alpha1/api.gen.ts @@ -70,7 +70,6 @@ export class API extends ParentAPI { unmarshalInstanceGroup, ) - /** * Create Instance group. Create a new Instance group. You must specify a `template_id`, capacity and Load Balancer object. * @@ -90,8 +89,9 @@ export class API extends ParentAPI { unmarshalInstanceGroup, ) - - protected pageOfListInstanceGroups = (request: Readonly = {}) => + protected pageOfListInstanceGroups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -99,12 +99,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInstanceGroupsResponse, ) - + /** * List Instance groups. List all Instance groups, for a Scaleway Organization or Scaleway Project. By default, the Instance groups returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -112,9 +115,12 @@ export class API extends ParentAPI { * @returns A Promise of ListInstanceGroupsResponse */ listInstanceGroups = (request: Readonly = {}) => - enrichForPagination('instanceGroups', this.pageOfListInstanceGroups, request) + enrichForPagination( + 'instanceGroups', + this.pageOfListInstanceGroups, + request, + ) - /** * Update Instance group. Update the parameters of an existing Instance group, specified by its `instance_group_id`. * @@ -134,21 +140,17 @@ export class API extends ParentAPI { unmarshalInstanceGroup, ) - /** * Delete Instance group. Delete an existing Instance group, specified by its `instance_group_id`. Deleting an Instance group is permanent, and cannot be undone. * * @param request - The request {@link DeleteInstanceGroupRequest} */ deleteInstanceGroup = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam('instanceGroupId', request.instanceGroupId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-groups/${validatePathParam('instanceGroupId', request.instanceGroupId)}`, + }) - /** * Create Instance template. Create a new Instance template. This specifies the details of the Instance (commercial type, zone, image, volumes etc.) that will be in the Instance group. * @@ -168,7 +170,6 @@ export class API extends ParentAPI { unmarshalInstanceTemplate, ) - /** * Update Instance template. Update an Instance template, such as its commercial offer type, image or volume template. * @@ -188,7 +189,6 @@ export class API extends ParentAPI { unmarshalInstanceTemplate, ) - /** * Get Instance template. Get an existing Instance template from its `template_id`. * @@ -204,22 +204,20 @@ export class API extends ParentAPI { unmarshalInstanceTemplate, ) - /** * Delete Instance template. Delete an existing Instance template. This action is permanent and cannot be undone. * * @param request - The request {@link DeleteInstanceTemplateRequest} */ deleteInstanceTemplate = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-templates/${validatePathParam('templateId', request.templateId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-templates/${validatePathParam('templateId', request.templateId)}`, + }) - - protected pageOfListInstanceTemplates = (request: Readonly = {}) => + protected pageOfListInstanceTemplates = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -227,22 +225,30 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInstanceTemplatesResponse, ) - + /** * List Instance templates. List all Instance templates, for a Scaleway Organization or Scaleway Project. By default, the Instance templates returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * * @param request - The request {@link ListInstanceTemplatesRequest} * @returns A Promise of ListInstanceTemplatesResponse */ - listInstanceTemplates = (request: Readonly = {}) => - enrichForPagination('instanceTemplates', this.pageOfListInstanceTemplates, request) + listInstanceTemplates = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'instanceTemplates', + this.pageOfListInstanceTemplates, + request, + ) - /** * Create scaling policy. Create a new scaling policy. You must specify a `policy_id`, capacity and Load Balancer object. * @@ -262,7 +268,6 @@ export class API extends ParentAPI { unmarshalInstancePolicy, ) - /** * Update scaling policy. Update the parameters of an existing scaling policy, specified by its `policy_id`. * @@ -282,8 +287,9 @@ export class API extends ParentAPI { unmarshalInstancePolicy, ) - - protected pageOfListInstancePolicies = (request: Readonly) => + protected pageOfListInstancePolicies = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -292,12 +298,15 @@ export class API extends ParentAPI { ['instance_group_id', request.instanceGroupId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInstancePoliciesResponse, ) - + /** * List scaling policies. List all scaling policies, for a Scaleway Organization or Scaleway Project. By default, the policies returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -307,7 +316,6 @@ export class API extends ParentAPI { listInstancePolicies = (request: Readonly) => enrichForPagination('policies', this.pageOfListInstancePolicies, request) - /** * Get scaling policy. Retrieve information about an existing scaling policy, specified by its `policy_id`. Its full details are returned in the response object. * @@ -323,22 +331,20 @@ export class API extends ParentAPI { unmarshalInstancePolicy, ) - /** * Delete scaling policy. Delete an existing scaling policy, specified by its `policy_id`. Deleting a scaling policy is permanent, and cannot be undone. * * @param request - The request {@link DeleteInstancePolicyRequest} */ deleteInstancePolicy = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-policies/${validatePathParam('policyId', request.policyId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/autoscaling/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/instance-policies/${validatePathParam('policyId', request.policyId)}`, + }) - - protected pageOfListInstanceGroupEvents = (request: Readonly) => + protected pageOfListInstanceGroupEvents = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -346,21 +352,27 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInstanceGroupEventsResponse, ) - + /** * List events. List all events for a given Instance group. By default, the events are ordered by creation date in descending order, though this can be modified via the `order_by` field. * * @param request - The request {@link ListInstanceGroupEventsRequest} * @returns A Promise of ListInstanceGroupEventsResponse */ - listInstanceGroupEvents = (request: Readonly) => - enrichForPagination('instanceEvents', this.pageOfListInstanceGroupEvents, request) - - + listInstanceGroupEvents = ( + request: Readonly, + ) => + enrichForPagination( + 'instanceEvents', + this.pageOfListInstanceGroupEvents, + request, + ) } - diff --git a/packages_generated/autoscaling/src/v1alpha1/index.gen.ts b/packages_generated/autoscaling/src/v1alpha1/index.gen.ts index 4296d10c8..16d2e1053 100644 --- a/packages_generated/autoscaling/src/v1alpha1/index.gen.ts +++ b/packages_generated/autoscaling/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { Capacity, diff --git a/packages_generated/autoscaling/src/v1alpha1/marshalling.gen.ts b/packages_generated/autoscaling/src/v1alpha1/marshalling.gen.ts index 23a205de7..e155905e5 100644 --- a/packages_generated/autoscaling/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/autoscaling/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,10 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMapOfObject, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Capacity, @@ -115,7 +120,9 @@ export const unmarshalInstancePolicy = (data: unknown): InstancePolicy => { } as InstancePolicy } -const unmarshalVolumeInstanceTemplateFromEmpty = (data: unknown): VolumeInstanceTemplateFromEmpty => { +const unmarshalVolumeInstanceTemplateFromEmpty = ( + data: unknown, +): VolumeInstanceTemplateFromEmpty => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeInstanceTemplateFromEmpty' failed as data isn't a dictionary.`, @@ -127,7 +134,9 @@ const unmarshalVolumeInstanceTemplateFromEmpty = (data: unknown): VolumeInstance } as VolumeInstanceTemplateFromEmpty } -const unmarshalVolumeInstanceTemplateFromSnapshot = (data: unknown): VolumeInstanceTemplateFromSnapshot => { +const unmarshalVolumeInstanceTemplateFromSnapshot = ( + data: unknown, +): VolumeInstanceTemplateFromSnapshot => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeInstanceTemplateFromSnapshot' failed as data isn't a dictionary.`, @@ -140,7 +149,9 @@ const unmarshalVolumeInstanceTemplateFromSnapshot = (data: unknown): VolumeInsta } as VolumeInstanceTemplateFromSnapshot } -const unmarshalVolumeInstanceTemplate = (data: unknown): VolumeInstanceTemplate => { +const unmarshalVolumeInstanceTemplate = ( + data: unknown, +): VolumeInstanceTemplate => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeInstanceTemplate' failed as data isn't a dictionary.`, @@ -149,8 +160,12 @@ const unmarshalVolumeInstanceTemplate = (data: unknown): VolumeInstanceTemplate return { boot: data.boot, - fromEmpty: data.from_empty ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) : undefined, - fromSnapshot: data.from_snapshot ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) : undefined, + fromEmpty: data.from_empty + ? unmarshalVolumeInstanceTemplateFromEmpty(data.from_empty) + : undefined, + fromSnapshot: data.from_snapshot + ? unmarshalVolumeInstanceTemplateFromSnapshot(data.from_snapshot) + : undefined, name: data.name, perfIops: data.perf_iops, tags: data.tags, @@ -181,7 +196,10 @@ export const unmarshalInstanceTemplate = (data: unknown): InstanceTemplate => { status: data.status, tags: data.tags, updatedAt: unmarshalDate(data.updated_at), - volumes: unmarshalMapOfObject(data.volumes, unmarshalVolumeInstanceTemplate), + volumes: unmarshalMapOfObject( + data.volumes, + unmarshalVolumeInstanceTemplate, + ), zone: data.zone, } as InstanceTemplate } @@ -203,7 +221,9 @@ const unmarshalInstanceGroupEvent = (data: unknown): InstanceGroupEvent => { } as InstanceGroupEvent } -export const unmarshalListInstanceGroupEventsResponse = (data: unknown): ListInstanceGroupEventsResponse => { +export const unmarshalListInstanceGroupEventsResponse = ( + data: unknown, +): ListInstanceGroupEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceGroupEventsResponse' failed as data isn't a dictionary.`, @@ -211,12 +231,17 @@ export const unmarshalListInstanceGroupEventsResponse = (data: unknown): ListIns } return { - instanceEvents: unmarshalArrayOfObject(data.instance_events, unmarshalInstanceGroupEvent), + instanceEvents: unmarshalArrayOfObject( + data.instance_events, + unmarshalInstanceGroupEvent, + ), totalCount: data.total_count, } as ListInstanceGroupEventsResponse } -export const unmarshalListInstanceGroupsResponse = (data: unknown): ListInstanceGroupsResponse => { +export const unmarshalListInstanceGroupsResponse = ( + data: unknown, +): ListInstanceGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceGroupsResponse' failed as data isn't a dictionary.`, @@ -224,12 +249,17 @@ export const unmarshalListInstanceGroupsResponse = (data: unknown): ListInstance } return { - instanceGroups: unmarshalArrayOfObject(data.instance_groups, unmarshalInstanceGroup), + instanceGroups: unmarshalArrayOfObject( + data.instance_groups, + unmarshalInstanceGroup, + ), totalCount: data.total_count, } as ListInstanceGroupsResponse } -export const unmarshalListInstancePoliciesResponse = (data: unknown): ListInstancePoliciesResponse => { +export const unmarshalListInstancePoliciesResponse = ( + data: unknown, +): ListInstancePoliciesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstancePoliciesResponse' failed as data isn't a dictionary.`, @@ -242,7 +272,9 @@ export const unmarshalListInstancePoliciesResponse = (data: unknown): ListInstan } as ListInstancePoliciesResponse } -export const unmarshalListInstanceTemplatesResponse = (data: unknown): ListInstanceTemplatesResponse => { +export const unmarshalListInstanceTemplatesResponse = ( + data: unknown, +): ListInstanceTemplatesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceTemplatesResponse' failed as data isn't a dictionary.`, @@ -250,7 +282,10 @@ export const unmarshalListInstanceTemplatesResponse = (data: unknown): ListInsta } return { - instanceTemplates: unmarshalArrayOfObject(data.instance_templates, unmarshalInstanceTemplate), + instanceTemplates: unmarshalArrayOfObject( + data.instance_templates, + unmarshalInstanceTemplate, + ), totalCount: data.total_count, } as ListInstanceTemplatesResponse } @@ -277,8 +312,8 @@ export const marshalCreateInstanceGroupRequest = ( request: CreateInstanceGroupRequest, defaults: DefaultValues, ): Record => ({ - capacity: marshalCapacity(request.capacity, defaults), - loadbalancer: marshalLoadbalancer(request.loadbalancer, defaults), + capacity: marshalCapacity(request.capacity, defaults), + loadbalancer: marshalLoadbalancer(request.loadbalancer, defaults), name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags, @@ -293,14 +328,10 @@ const marshalMetric = ( name: request.name, operator: request.operator, sampling_range_min: request.samplingRangeMin, - threshold: request.threshold, + threshold: request.threshold, ...resolveOneOf([ - {param: 'managed_metric', - value: request.managedMetric, - }, - {param: 'cockpit_metric_name', - value: request.cockpitMetricName, - }, + { param: 'managed_metric', value: request.managedMetric }, + { param: 'cockpit_metric_name', value: request.cockpitMetricName }, ]), }) @@ -313,11 +344,14 @@ export const marshalCreateInstancePolicyRequest = ( name: request.name, priority: request.priority, type: request.type, - value: request.value, + value: request.value, ...resolveOneOf([ - {param: 'metric', - value: (request.metric !== undefined) ? marshalMetric(request.metric, defaults) - : undefined, + { + param: 'metric', + value: + request.metric !== undefined + ? marshalMetric(request.metric, defaults) + : undefined, }, ]), }) @@ -344,22 +378,27 @@ const marshalVolumeInstanceTemplate = ( boot: request.boot, name: request.name, tags: request.tags, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - {param: 'from_empty', - value: (request.fromEmpty !== undefined) ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty, defaults) - : undefined, - }, - {param: 'from_snapshot', - value: (request.fromSnapshot !== undefined) ? marshalVolumeInstanceTemplateFromSnapshot(request.fromSnapshot, defaults) - : undefined, + { + param: 'from_empty', + value: + request.fromEmpty !== undefined + ? marshalVolumeInstanceTemplateFromEmpty(request.fromEmpty, defaults) + : undefined, }, - ]), - ...resolveOneOf([ - {param: 'perf_iops', - value: request.perfIops, + { + param: 'from_snapshot', + value: + request.fromSnapshot !== undefined + ? marshalVolumeInstanceTemplateFromSnapshot( + request.fromSnapshot, + defaults, + ) + : undefined, }, ]), + ...resolveOneOf([{ param: 'perf_iops', value: request.perfIops }]), }) export const marshalCreateInstanceTemplateRequest = ( @@ -377,7 +416,13 @@ export const marshalCreateInstanceTemplateRequest = ( public_ips_v6_count: request.publicIpsV6Count, security_group_id: request.securityGroupId, tags: request.tags, - volumes: Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeInstanceTemplate(value, defaults) }), {}), + volumes: Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeInstanceTemplate(value, defaults), + }), + {}, + ), }) const marshalUpdateInstanceGroupRequestCapacity = ( @@ -400,8 +445,17 @@ export const marshalUpdateInstanceGroupRequest = ( request: UpdateInstanceGroupRequest, defaults: DefaultValues, ): Record => ({ - capacity: ((request.capacity !== undefined) ? marshalUpdateInstanceGroupRequestCapacity(request.capacity, defaults): undefined), - loadbalancer: ((request.loadbalancer !== undefined) ? marshalUpdateInstanceGroupRequestLoadbalancer(request.loadbalancer, defaults): undefined), + capacity: + request.capacity !== undefined + ? marshalUpdateInstanceGroupRequestCapacity(request.capacity, defaults) + : undefined, + loadbalancer: + request.loadbalancer !== undefined + ? marshalUpdateInstanceGroupRequestLoadbalancer( + request.loadbalancer, + defaults, + ) + : undefined, name: request.name, tags: request.tags, }) @@ -414,14 +468,10 @@ const marshalUpdateInstancePolicyRequestMetric = ( name: request.name, operator: request.operator, sampling_range_min: request.samplingRangeMin, - threshold: request.threshold, + threshold: request.threshold, ...resolveOneOf([ - {param: 'managed_metric', - value: request.managedMetric, - }, - {param: 'cockpit_metric_name', - value: request.cockpitMetricName, - }, + { param: 'managed_metric', value: request.managedMetric }, + { param: 'cockpit_metric_name', value: request.cockpitMetricName }, ]), }) @@ -433,11 +483,14 @@ export const marshalUpdateInstancePolicyRequest = ( name: request.name, priority: request.priority, type: request.type, - value: request.value, + value: request.value, ...resolveOneOf([ - {param: 'metric', - value: (request.metric !== undefined) ? marshalUpdateInstancePolicyRequestMetric(request.metric, defaults) - : undefined, + { + param: 'metric', + value: + request.metric !== undefined + ? marshalUpdateInstancePolicyRequestMetric(request.metric, defaults) + : undefined, }, ]), }) @@ -456,5 +509,14 @@ export const marshalUpdateInstanceTemplateRequest = ( public_ips_v6_count: request.publicIpsV6Count, security_group_id: request.securityGroupId, tags: request.tags, - volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeInstanceTemplate(value, defaults) }), {}): undefined), + volumes: + request.volumes !== undefined + ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeInstanceTemplate(value, defaults), + }), + {}, + ) + : undefined, }) diff --git a/packages_generated/autoscaling/src/v1alpha1/types.gen.ts b/packages_generated/autoscaling/src/v1alpha1/types.gen.ts index 467a66712..c507039de 100644 --- a/packages_generated/autoscaling/src/v1alpha1/types.gen.ts +++ b/packages_generated/autoscaling/src/v1alpha1/types.gen.ts @@ -1,12 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' +import type { Zone as ScwZone } from '@scaleway/sdk-client' - -export type InstanceGroupEventLevel = - | 'info' - | 'success' - | 'error' +export type InstanceGroupEventLevel = 'info' | 'success' | 'error' export type InstanceGroupEventSource = | 'unknown_source' @@ -15,10 +11,7 @@ export type InstanceGroupEventSource = | 'instance_manager' | 'supervisor' -export type InstancePolicyAction = - | 'unknown_action' - | 'scale_up' - | 'scale_down' +export type InstancePolicyAction = 'unknown_action' | 'scale_up' | 'scale_down' export type InstancePolicyType = | 'unknown_type' @@ -26,10 +19,7 @@ export type InstancePolicyType = | 'percent_of_total_group' | 'set_total_group' -export type InstanceTemplateStatus = - | 'unknown_status' - | 'ready' - | 'error' +export type InstanceTemplateStatus = 'unknown_status' | 'ready' | 'error' export type ListInstanceGroupEventsRequestOrderBy = | 'created_at_desc' @@ -96,13 +86,11 @@ export interface VolumeInstanceTemplateFromEmpty { size: number } - export interface VolumeInstanceTemplateFromSnapshot { size?: number snapshotId: string } - export interface Capacity { /** * Maximum count of Instances for the Instance group. @@ -118,7 +106,6 @@ export interface Capacity { cooldownDelay?: string } - export interface Loadbalancer { /** * Load Balancer ID. @@ -134,7 +121,6 @@ export interface Loadbalancer { privateNetworkId: string } - export interface Metric { /** * Name or description of the metric policy. @@ -170,7 +156,6 @@ export interface Metric { threshold: number } - export interface VolumeInstanceTemplate { /** * Name of the volume. @@ -208,7 +193,6 @@ export interface VolumeInstanceTemplate { volumeType: VolumeInstanceTemplateVolumeType } - export interface InstanceGroupEvent { /** * Instance group event ID. @@ -236,7 +220,6 @@ export interface InstanceGroupEvent { details?: string } - export interface InstanceGroup { /** * Instance group ID. @@ -284,7 +267,6 @@ export interface InstanceGroup { zone: ScwZone } - export interface InstancePolicy { /** * Scaling policy ID. @@ -326,7 +308,6 @@ export interface InstancePolicy { zone: ScwZone } - export interface InstanceTemplate { /** * ID of Instance template resource. @@ -398,7 +379,6 @@ export interface InstanceTemplate { zone: ScwZone } - export interface UpdateInstanceGroupRequestCapacity { /** * Maximum count of Instances for the Instance group. @@ -414,7 +394,6 @@ export interface UpdateInstanceGroupRequestCapacity { cooldownDelay?: string } - export interface UpdateInstanceGroupRequestLoadbalancer { /** * Load Balancer backend IDs. @@ -422,7 +401,6 @@ export interface UpdateInstanceGroupRequestLoadbalancer { backendIds?: string[] } - export interface UpdateInstancePolicyRequestMetric { /** * Name or description of your metric policy. @@ -458,7 +436,6 @@ export interface UpdateInstancePolicyRequestMetric { threshold?: number } - export type CreateInstanceGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -490,7 +467,6 @@ export type CreateInstanceGroupRequest = { loadbalancer: Loadbalancer } - export type CreateInstancePolicyRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -528,7 +504,6 @@ export type CreateInstancePolicyRequest = { instanceGroupId: string } - export type CreateInstanceTemplateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -584,7 +559,6 @@ export type CreateInstanceTemplateRequest = { cloudInit?: string } - export type DeleteInstanceGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -596,7 +570,6 @@ export type DeleteInstanceGroupRequest = { instanceGroupId: string } - export type DeleteInstancePolicyRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -608,7 +581,6 @@ export type DeleteInstancePolicyRequest = { policyId: string } - export type DeleteInstanceTemplateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -620,7 +592,6 @@ export type DeleteInstanceTemplateRequest = { templateId: string } - export type GetInstanceGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -632,7 +603,6 @@ export type GetInstanceGroupRequest = { instanceGroupId: string } - export type GetInstancePolicyRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -644,7 +614,6 @@ export type GetInstancePolicyRequest = { policyId: string } - export type GetInstanceTemplateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -656,7 +625,6 @@ export type GetInstanceTemplateRequest = { templateId: string } - export type ListInstanceGroupEventsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -680,7 +648,6 @@ export type ListInstanceGroupEventsRequest = { pageSize?: number } - export interface ListInstanceGroupEventsResponse { /** * Paginated list of Instance groups. @@ -692,7 +659,6 @@ export interface ListInstanceGroupEventsResponse { totalCount: number } - export type ListInstanceGroupsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -712,7 +678,6 @@ export type ListInstanceGroupsRequest = { pageSize?: number } - export interface ListInstanceGroupsResponse { /** * Paginated list of Instance groups. @@ -724,7 +689,6 @@ export interface ListInstanceGroupsResponse { totalCount: number } - export type ListInstancePoliciesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -748,7 +712,6 @@ export type ListInstancePoliciesRequest = { pageSize?: number } - export interface ListInstancePoliciesResponse { /** * Paginated list of policies. @@ -760,7 +723,6 @@ export interface ListInstancePoliciesResponse { totalCount: number } - export type ListInstanceTemplatesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -780,7 +742,6 @@ export type ListInstanceTemplatesRequest = { pageSize?: number } - export interface ListInstanceTemplatesResponse { /** * Count of all templates matching the requested criteria. @@ -792,7 +753,6 @@ export interface ListInstanceTemplatesResponse { instanceTemplates: InstanceTemplate[] } - export type UpdateInstanceGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -820,7 +780,6 @@ export type UpdateInstanceGroupRequest = { loadbalancer?: UpdateInstanceGroupRequestLoadbalancer } - export type UpdateInstancePolicyRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -858,7 +817,6 @@ export type UpdateInstancePolicyRequest = { priority?: number } - export type UpdateInstanceTemplateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -913,5 +871,3 @@ export type UpdateInstanceTemplateRequest = { */ cloudInit?: string } - - diff --git a/packages_generated/baremetal/src/v1/api.gen.ts b/packages_generated/baremetal/src/v1/api.gen.ts index 03eecebc2..a860bbf81 100644 --- a/packages_generated/baremetal/src/v1/api.gen.ts +++ b/packages_generated/baremetal/src/v1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_BAREMETAL,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_BAREMETAL } from './content.gen.js' import { marshalAddOptionServerRequest, unmarshalBMCAccess, @@ -109,18 +109,17 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -132,7 +131,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['status', request.status], ['tags', request.tags], @@ -140,7 +142,7 @@ export class API extends ParentAPI { }, unmarshalListServersResponse, ) - + /** * List Elastic Metal servers for an Organization. List Elastic Metal servers for a specific Organization. * @@ -150,7 +152,6 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) - /** * Get a specific Elastic Metal server. Get full details of an existing Elastic Metal server associated with the ID. * @@ -165,7 +166,7 @@ export class API extends ParentAPI { }, unmarshalServer, ) - + /** * Waits for {@link Server} to be in a final state. * @@ -178,13 +179,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES_BAREMETAL.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SERVER_TRANSIENT_STATUSES_BAREMETAL.includes(res.status), + )), this.getServer, request, options, ) - /** * Create an Elastic Metal server. Create a new Elastic Metal server. Once the server is created, proceed with the [installation of an OS](#post-3e949e). * @@ -204,7 +208,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Update an Elastic Metal server. Update the server associated with the ID. You can update parameters such as the server's name, tags, description and protection flag. Any parameters left null in the request body are not updated. * @@ -224,7 +227,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Install an Elastic Metal server. Install an Operating System (OS) on the Elastic Metal server with a specific ID. * @@ -244,7 +246,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Return server metrics. Get the ping status of the server associated with the ID. * @@ -260,7 +261,6 @@ export class API extends ParentAPI { unmarshalGetServerMetricsResponse, ) - /** * Delete an Elastic Metal server. Delete the server associated with the ID. * @@ -276,7 +276,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Reboot an Elastic Metal server. Reboot the Elastic Metal server associated with the ID, use the `boot_type` `rescue` to reboot the server in rescue mode. * @@ -296,7 +295,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Start an Elastic Metal server. Start the server associated with the ID. * @@ -316,7 +314,6 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Stop an Elastic Metal server. Stop the server associated with the ID. The server remains allocated to your account and all data remains on the local storage of the server. * @@ -334,8 +331,9 @@ export class API extends ParentAPI { unmarshalServer, ) - - protected pageOfListServerEvents = (request: Readonly) => + protected pageOfListServerEvents = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -343,12 +341,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListServerEventsResponse, ) - + /** * List server events. List event (i.e. start/stop/reboot) associated to the server ID. * @@ -358,14 +359,15 @@ export class API extends ParentAPI { listServerEvents = (request: Readonly) => enrichForPagination('events', this.pageOfListServerEvents, request) - /** * Get default partitioning schema. Get the default partitioning schema for the given offer ID and OS ID. * * @param request - The request {@link GetDefaultPartitioningSchemaRequest} * @returns A Promise of Schema */ - getDefaultPartitioningSchema = (request: Readonly) => + getDefaultPartitioningSchema = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -378,25 +380,23 @@ export class API extends ParentAPI { unmarshalSchema, ) - /** * Validate client partitioning schema. Validate the incoming partitioning schema from a user before installing the server. Return default ErrorCode if invalid. * * @param request - The request {@link ValidatePartitioningSchemaRequest} */ - validatePartitioningSchema = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalValidatePartitioningSchemaRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`, - }, - ) + validatePartitioningSchema = ( + request: Readonly, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalValidatePartitioningSchemaRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/partitioning-schemas/validate`, + }) - /** * Start BMC access. Start BMC (Baseboard Management Controller) access associated with the ID. The BMC (Baseboard Management Controller) access is available one hour after the installation of the server. @@ -419,7 +419,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalBMCAccess, ) - /** * Get BMC access. Get the BMC (Baseboard Management Controller) access associated with the ID, including the URL and login information needed to connect. * @@ -435,21 +434,17 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalBMCAccess, ) - /** * Stop BMC access. Stop BMC (Baseboard Management Controller) access associated with the ID. * * @param request - The request {@link StopBMCAccessRequest} */ stopBMCAccess = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, + }) - /** * Update IP. Configure the IP address associated with the server ID and IP ID. You can use this method to set a reverse DNS for an IP address. * @@ -469,7 +464,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalIP, ) - /** * Add server option. Add an option, such as Private Networks, to a specific server. * @@ -489,7 +483,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalServer, ) - /** * Delete server option. Delete an option from a specific server. * @@ -505,14 +498,15 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalServer, ) - /** * Migrate server offer. Migrate server with hourly offer to monthly offer. * * @param request - The request {@link MigrateServerToMonthlyOfferRequest} * @returns A Promise of Server */ - migrateServerToMonthlyOffer = (request: Readonly) => + migrateServerToMonthlyOffer = ( + request: Readonly, + ) => this.client.fetch( { method: 'POST', @@ -521,7 +515,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalServer, ) - protected pageOfListOffers = (request: Readonly = {}) => this.client.fetch( { @@ -530,13 +523,16 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass urlParams: urlParams( ['name', request.name], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['subscription_period', request.subscriptionPeriod], ), }, unmarshalListOffersResponse, ) - + /** * List offers. List all available Elastic Metal server configurations. * @@ -546,7 +542,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass listOffers = (request: Readonly = {}) => enrichForPagination('offers', this.pageOfListOffers, request) - /** * Get offer. Get details of an offer identified by its offer ID. * @@ -562,7 +557,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalOffer, ) - /** * Get option. Return specific option for the ID. * @@ -578,7 +572,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalOption, ) - protected pageOfListOptions = (request: Readonly = {}) => this.client.fetch( { @@ -588,12 +581,15 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass ['name', request.name], ['offer_id', request.offerId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListOptionsResponse, ) - + /** * List options. List all options matching with filters. * @@ -603,8 +599,9 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass listOptions = (request: Readonly = {}) => enrichForPagination('options', this.pageOfListOptions, request) - - protected pageOfListSettings = (request: Readonly = {}) => + protected pageOfListSettings = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -612,13 +609,19 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListSettingsResponse, ) - + /** * List all settings. Return all settings for a Project ID. * @@ -628,7 +631,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass listSettings = (request: Readonly = {}) => enrichForPagination('settings', this.pageOfListSettings, request) - /** * Update setting. Update a setting for a Project ID (enable or disable). * @@ -648,7 +650,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass unmarshalSetting, ) - protected pageOfListOS = (request: Readonly = {}) => this.client.fetch( { @@ -657,12 +658,15 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass urlParams: urlParams( ['offer_id', request.offerId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListOSResponse, ) - + /** * List available OSes. List all OSes that are available for installation on Elastic Metal servers. * @@ -672,7 +676,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass listOS = (request: Readonly = {}) => enrichForPagination('os', this.pageOfListOS, request) - /** * Get OS with an ID. Return the specific OS for the ID. * @@ -687,8 +690,6 @@ After adding the BMC option, you need to Get Remote Access to get the login/pass }, unmarshalOS, ) - - } /** @@ -699,24 +700,26 @@ export class PrivateNetworkAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-2', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: ['fr-par-2'], + }) + /** * Add a server to a Private Network. * * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest} * @returns A Promise of ServerPrivateNetwork */ - addServerPrivateNetwork = (request: Readonly) => + addServerPrivateNetwork = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings), + marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -725,18 +728,22 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalServerPrivateNetwork, ) - /** * Set multiple Private Networks on a server. * * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest} * @returns A Promise of SetServerPrivateNetworksResponse */ - setServerPrivateNetworks = (request: Readonly) => + setServerPrivateNetworks = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings), + marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -745,8 +752,9 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalSetServerPrivateNetworksResponse, ) - - protected pageOfListServerPrivateNetworks = (request: Readonly = {}) => + protected pageOfListServerPrivateNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -755,7 +763,10 @@ export class PrivateNetworkAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId], @@ -763,30 +774,32 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalListServerPrivateNetworksResponse, ) - + /** * List the Private Networks of a server. * * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest} * @returns A Promise of ListServerPrivateNetworksResponse */ - listServerPrivateNetworks = (request: Readonly = {}) => - enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request) + listServerPrivateNetworks = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'serverPrivateNetworks', + this.pageOfListServerPrivateNetworks, + request, + ) - /** * Delete a Private Network. * * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} */ - deleteServerPrivateNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }, - ) - - + deleteServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }) } - diff --git a/packages_generated/baremetal/src/v1/content.gen.ts b/packages_generated/baremetal/src/v1/content.gen.ts index 2eab0ada2..329ac1451 100644 --- a/packages_generated/baremetal/src/v1/content.gen.ts +++ b/packages_generated/baremetal/src/v1/content.gen.ts @@ -6,7 +6,6 @@ import type { ServerStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link ServerInstallStatus}. */ export const SERVER_INSTALL_TRANSIENT_STATUSES: ServerInstallStatus[] = [ 'to_install', @@ -14,10 +13,8 @@ export const SERVER_INSTALL_TRANSIENT_STATUSES: ServerInstallStatus[] = [ ] /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ -export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = [ - 'attaching', - 'detaching', -] +export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = + ['attaching', 'detaching'] /** Lists transient statutes of the enum {@link ServerStatus}. */ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ @@ -29,4 +26,3 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ 'resetting', 'migrating', ] - diff --git a/packages_generated/baremetal/src/v1/marshalling.gen.ts b/packages_generated/baremetal/src/v1/marshalling.gen.ts index 4c4a95c9c..668d77869 100644 --- a/packages_generated/baremetal/src/v1/marshalling.gen.ts +++ b/packages_generated/baremetal/src/v1/marshalling.gen.ts @@ -1,5 +1,12 @@ - -import { isJSONObject, marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, unmarshalTimeSeries, } from '@scaleway/sdk-client' +import { + isJSONObject, + marshalBlobToScwFile, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, + unmarshalTimeSeries, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { SchemaPartition, @@ -98,7 +105,10 @@ const unmarshalSchemaDisk = (data: unknown): SchemaDisk => { return { device: data.device, - partitions: unmarshalArrayOfObject(data.partitions, unmarshalSchemaPartition), + partitions: unmarshalArrayOfObject( + data.partitions, + unmarshalSchemaPartition, + ), } as SchemaDisk } @@ -151,7 +161,10 @@ export const unmarshalSchema = (data: unknown): Schema => { return { disks: unmarshalArrayOfObject(data.disks, unmarshalSchemaDisk), - filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalSchemaFilesystem), + filesystems: unmarshalArrayOfObject( + data.filesystems, + unmarshalSchemaFilesystem, + ), raids: unmarshalArrayOfObject(data.raids, unmarshalSchemaRAID), zfs: data.zfs ? unmarshalSchemaZFS(data.zfs) : undefined, } as Schema @@ -181,8 +194,7 @@ const unmarshalCertificationOption = (data: unknown): CertificationOption => { ) } - return { - } as CertificationOption + return {} as CertificationOption } const unmarshalLicenseOption = (data: unknown): LicenseOption => { @@ -209,7 +221,9 @@ const unmarshalPrivateNetworkOption = (data: unknown): PrivateNetworkOption => { } as PrivateNetworkOption } -const unmarshalPublicBandwidthOption = (data: unknown): PublicBandwidthOption => { +const unmarshalPublicBandwidthOption = ( + data: unknown, +): PublicBandwidthOption => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicBandwidthOption' failed as data isn't a dictionary.`, @@ -228,8 +242,7 @@ const unmarshalRemoteAccessOption = (data: unknown): RemoteAccessOption => { ) } - return { - } as RemoteAccessOption + return {} as RemoteAccessOption } const unmarshalServerInstall = (data: unknown): ServerInstall => { @@ -242,7 +255,9 @@ const unmarshalServerInstall = (data: unknown): ServerInstall => { return { hostname: data.hostname, osId: data.os_id, - partitioningSchema: data.partitioning_schema ? unmarshalSchema(data.partitioning_schema) : undefined, + partitioningSchema: data.partitioning_schema + ? unmarshalSchema(data.partitioning_schema) + : undefined, serviceUrl: data.service_url, serviceUser: data.service_user, sshKeyIds: data.ssh_key_ids, @@ -259,15 +274,23 @@ const unmarshalServerOption = (data: unknown): ServerOption => { } return { - certification: data.certification ? unmarshalCertificationOption(data.certification) : undefined, + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, expiresAt: unmarshalDate(data.expires_at), id: data.id, license: data.license ? unmarshalLicenseOption(data.license) : undefined, manageable: data.manageable, name: data.name, - privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : undefined, - publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : undefined, - remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : undefined, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, status: data.status, } as ServerOption } @@ -308,7 +331,9 @@ export const unmarshalServer = (data: unknown): Server => { pingStatus: data.ping_status, projectId: data.project_id, protected: data.protected, - rescueServer: data.rescue_server ? unmarshalServerRescueServer(data.rescue_server) : undefined, + rescueServer: data.rescue_server + ? unmarshalServerRescueServer(data.rescue_server) + : undefined, status: data.status, tags: data.tags, updatedAt: unmarshalDate(data.updated_at), @@ -349,8 +374,12 @@ export const unmarshalOS = (data: unknown): OS => { logoUrl: data.logo_url, name: data.name, password: data.password ? unmarshalOSOSField(data.password) : undefined, - servicePassword: data.service_password ? unmarshalOSOSField(data.service_password) : undefined, - serviceUser: data.service_user ? unmarshalOSOSField(data.service_user) : undefined, + servicePassword: data.service_password + ? unmarshalOSOSField(data.service_password) + : undefined, + serviceUser: data.service_user + ? unmarshalOSOSField(data.service_user) + : undefined, ssh: data.ssh ? unmarshalOSOSField(data.ssh) : undefined, user: data.user ? unmarshalOSOSField(data.user) : undefined, version: data.version, @@ -423,7 +452,9 @@ const unmarshalOfferOptionOffer = (data: unknown): OfferOptionOffer => { } return { - certification: data.certification ? unmarshalCertificationOption(data.certification) : undefined, + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, enabled: data.enabled, id: data.id, license: data.license ? unmarshalLicenseOption(data.license) : undefined, @@ -431,9 +462,15 @@ const unmarshalOfferOptionOffer = (data: unknown): OfferOptionOffer => { name: data.name, osId: data.os_id, price: data.price ? unmarshalMoney(data.price) : undefined, - privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : undefined, - publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : undefined, - remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : undefined, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, subscriptionPeriod: data.subscription_period, } as OfferOptionOffer } @@ -488,12 +525,22 @@ export const unmarshalOffer = (data: unknown): Offer => { name: data.name, operationPath: data.operation_path, options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer), - persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory), - pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : undefined, - pricePerMonth: data.price_per_month ? unmarshalMoney(data.price_per_month) : undefined, + persistentMemories: unmarshalArrayOfObject( + data.persistent_memories, + unmarshalPersistentMemory, + ), + pricePerHour: data.price_per_hour + ? unmarshalMoney(data.price_per_hour) + : undefined, + pricePerMonth: data.price_per_month + ? unmarshalMoney(data.price_per_month) + : undefined, privateBandwidth: data.private_bandwidth, quotaName: data.quota_name, - raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController), + raidControllers: unmarshalArrayOfObject( + data.raid_controllers, + unmarshalRaidController, + ), sharedBandwidth: data.shared_bandwidth, stock: data.stock, subscriptionPeriod: data.subscription_period, @@ -510,18 +557,28 @@ export const unmarshalOption = (data: unknown): Option => { } return { - certification: data.certification ? unmarshalCertificationOption(data.certification) : undefined, + certification: data.certification + ? unmarshalCertificationOption(data.certification) + : undefined, id: data.id, license: data.license ? unmarshalLicenseOption(data.license) : undefined, manageable: data.manageable, name: data.name, - privateNetwork: data.private_network ? unmarshalPrivateNetworkOption(data.private_network) : undefined, - publicBandwidth: data.public_bandwidth ? unmarshalPublicBandwidthOption(data.public_bandwidth) : undefined, - remoteAccess: data.remote_access ? unmarshalRemoteAccessOption(data.remote_access) : undefined, + privateNetwork: data.private_network + ? unmarshalPrivateNetworkOption(data.private_network) + : undefined, + publicBandwidth: data.public_bandwidth + ? unmarshalPublicBandwidthOption(data.public_bandwidth) + : undefined, + remoteAccess: data.remote_access + ? unmarshalRemoteAccessOption(data.remote_access) + : undefined, } as Option } -export const unmarshalServerPrivateNetwork = (data: unknown): ServerPrivateNetwork => { +export const unmarshalServerPrivateNetwork = ( + data: unknown, +): ServerPrivateNetwork => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`, @@ -570,7 +627,9 @@ export const unmarshalBMCAccess = (data: unknown): BMCAccess => { } as BMCAccess } -export const unmarshalGetServerMetricsResponse = (data: unknown): GetServerMetricsResponse => { +export const unmarshalGetServerMetricsResponse = ( + data: unknown, +): GetServerMetricsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerMetricsResponse' failed as data isn't a dictionary.`, @@ -595,7 +654,9 @@ export const unmarshalListOSResponse = (data: unknown): ListOSResponse => { } as ListOSResponse } -export const unmarshalListOffersResponse = (data: unknown): ListOffersResponse => { +export const unmarshalListOffersResponse = ( + data: unknown, +): ListOffersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`, @@ -608,7 +669,9 @@ export const unmarshalListOffersResponse = (data: unknown): ListOffersResponse = } as ListOffersResponse } -export const unmarshalListOptionsResponse = (data: unknown): ListOptionsResponse => { +export const unmarshalListOptionsResponse = ( + data: unknown, +): ListOptionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOptionsResponse' failed as data isn't a dictionary.`, @@ -636,7 +699,9 @@ const unmarshalServerEvent = (data: unknown): ServerEvent => { } as ServerEvent } -export const unmarshalListServerEventsResponse = (data: unknown): ListServerEventsResponse => { +export const unmarshalListServerEventsResponse = ( + data: unknown, +): ListServerEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`, @@ -649,7 +714,9 @@ export const unmarshalListServerEventsResponse = (data: unknown): ListServerEven } as ListServerEventsResponse } -export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListServerPrivateNetworksResponse => { +export const unmarshalListServerPrivateNetworksResponse = ( + data: unknown, +): ListServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -657,12 +724,17 @@ export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListS } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), totalCount: data.total_count, } as ListServerPrivateNetworksResponse } -export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { +export const unmarshalListServersResponse = ( + data: unknown, +): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -675,7 +747,9 @@ export const unmarshalListServersResponse = (data: unknown): ListServersResponse } as ListServersResponse } -export const unmarshalListSettingsResponse = (data: unknown): ListSettingsResponse => { +export const unmarshalListSettingsResponse = ( + data: unknown, +): ListSettingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSettingsResponse' failed as data isn't a dictionary.`, @@ -688,7 +762,9 @@ export const unmarshalListSettingsResponse = (data: unknown): ListSettingsRespon } as ListSettingsResponse } -export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetServerPrivateNetworksResponse => { +export const unmarshalSetServerPrivateNetworksResponse = ( + data: unknown, +): SetServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -696,7 +772,10 @@ export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetSer } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), } as SetServerPrivateNetworksResponse } @@ -726,7 +805,9 @@ const marshalSchemaDisk = ( defaults: DefaultValues, ): Record => ({ device: request.device, - partitions: request.partitions.map(elt => marshalSchemaPartition(elt, defaults)), + partitions: request.partitions.map(elt => + marshalSchemaPartition(elt, defaults), + ), }) const marshalSchemaFilesystem = ( @@ -751,17 +832,22 @@ const marshalSchemaZFS = ( request: SchemaZFS, defaults: DefaultValues, ): Record => ({ - pools: request.pools.map(elt => marshalSchemaPool(elt, defaults)), + pools: request.pools.map(elt => marshalSchemaPool(elt, defaults)), }) export const marshalSchema = ( request: Schema, defaults: DefaultValues, ): Record => ({ - disks: request.disks.map(elt => marshalSchemaDisk(elt, defaults)), - filesystems: request.filesystems.map(elt => marshalSchemaFilesystem(elt, defaults)), - raids: request.raids.map(elt => marshalSchemaRAID(elt, defaults)), - zfs: ((request.zfs !== undefined) ? marshalSchemaZFS(request.zfs, defaults): undefined), + disks: request.disks.map(elt => marshalSchemaDisk(elt, defaults)), + filesystems: request.filesystems.map(elt => + marshalSchemaFilesystem(elt, defaults), + ), + raids: request.raids.map(elt => marshalSchemaRAID(elt, defaults)), + zfs: + request.zfs !== undefined + ? marshalSchemaZFS(request.zfs, defaults) + : undefined, }) const marshalCreateServerRequestInstall = ( @@ -770,7 +856,10 @@ const marshalCreateServerRequestInstall = ( ): Record => ({ hostname: request.hostname, os_id: request.osId, - partitioning_schema: ((request.partitioningSchema !== undefined) ? marshalSchema(request.partitioningSchema, defaults): undefined), + partitioning_schema: + request.partitioningSchema !== undefined + ? marshalSchema(request.partitioningSchema, defaults) + : undefined, password: request.password, service_password: request.servicePassword, service_user: request.serviceUser, @@ -783,18 +872,25 @@ export const marshalCreateServerRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - install: ((request.install !== undefined) ? marshalCreateServerRequestInstall(request.install, defaults): undefined), + install: + request.install !== undefined + ? marshalCreateServerRequestInstall(request.install, defaults) + : undefined, name: request.name, offer_id: request.offerId, option_ids: request.optionIds, protected: request.protected, tags: request.tags, - user_data: request.userData, + user_data: request.userData, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -813,13 +909,19 @@ export const marshalInstallServerRequest = async ( ): Promise> => ({ hostname: request.hostname, os_id: request.osId, - partitioning_schema: ((request.partitioningSchema !== undefined) ? marshalSchema(request.partitioningSchema, defaults): undefined), + partitioning_schema: + request.partitioningSchema !== undefined + ? marshalSchema(request.partitioningSchema, defaults) + : undefined, password: request.password, service_password: request.servicePassword, service_user: request.serviceUser, ssh_key_ids: request.sshKeyIds, user: request.user, - user_data: ((request.userData !== undefined) ? await marshalBlobToScwFile(request.userData): undefined), + user_data: + request.userData !== undefined + ? await marshalBlobToScwFile(request.userData) + : undefined, }) export const marshalPrivateNetworkApiAddServerPrivateNetworkRequest = ( @@ -890,5 +992,8 @@ export const marshalValidatePartitioningSchemaRequest = ( ): Record => ({ offer_id: request.offerId, os_id: request.osId, - partitioning_schema: ((request.partitioningSchema !== undefined) ? marshalSchema(request.partitioningSchema, defaults): undefined), + partitioning_schema: + request.partitioningSchema !== undefined + ? marshalSchema(request.partitioningSchema, defaults) + : undefined, }) diff --git a/packages_generated/baremetal/src/v1/types.gen.ts b/packages_generated/baremetal/src/v1/types.gen.ts index 7c45d2da4..2e72bc648 100644 --- a/packages_generated/baremetal/src/v1/types.gen.ts +++ b/packages_generated/baremetal/src/v1/types.gen.ts @@ -1,17 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, TimeSeries, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Money, TimeSeries, Zone as ScwZone } from '@scaleway/sdk-client' +export type IPReverseStatus = 'unknown' | 'pending' | 'active' | 'error' -export type IPReverseStatus = - | 'unknown' - | 'pending' - | 'active' - | 'error' - -export type IPVersion = - | 'IPv4' - | 'IPv6' +export type IPVersion = 'IPv4' | 'IPv6' export type ListServerEventsRequestOrderBy = | 'created_at_asc' @@ -23,18 +16,11 @@ export type ListServerPrivateNetworksRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListServersRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListSettingsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListSettingsRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type OfferStock = - | 'empty' - | 'low' - | 'available' +export type OfferStock = 'empty' | 'low' | 'available' export type OfferSubscriptionPeriod = | 'unknown_subscription_period' @@ -76,10 +62,7 @@ export type SchemaRAIDLevel = | 'raid_level_6' | 'raid_level_10' -export type ServerBootType = - | 'unknown_boot_type' - | 'normal' - | 'rescue' +export type ServerBootType = 'unknown_boot_type' | 'normal' | 'rescue' export type ServerInstallStatus = | 'unknown' @@ -123,9 +106,7 @@ export type ServerStatus = | 'resetting' | 'migrating' -export type SettingType = - | 'unknown' - | 'smtp' +export type SettingType = 'unknown' | 'smtp' export interface SchemaPartition { label: SchemaPartitionLabel @@ -134,7 +115,6 @@ export interface SchemaPartition { useAllAvailableSpace: boolean } - export interface SchemaPool { name: string type: SchemaPoolType @@ -143,32 +123,27 @@ export interface SchemaPool { filesystemOptions: string[] } - export interface SchemaDisk { device: string partitions: SchemaPartition[] } - export interface SchemaFilesystem { device: string format: SchemaFilesystemFormat mountpoint: string } - export interface SchemaRAID { name: string level: SchemaRAIDLevel devices: string[] } - export interface SchemaZFS { pools: SchemaPool[] } - export interface Schema { disks: SchemaDisk[] raids: SchemaRAID[] @@ -176,29 +151,21 @@ export interface Schema { zfs?: SchemaZFS } - -export interface CertificationOption { -} - +export interface CertificationOption {} export interface LicenseOption { osId: string } - export interface PrivateNetworkOption { bandwidthInBps: number } - export interface PublicBandwidthOption { bandwidthInBps: number } - -export interface RemoteAccessOption { -} - +export interface RemoteAccessOption {} export interface CreateServerRequestInstall { /** @@ -235,7 +202,6 @@ export interface CreateServerRequestInstall { partitioningSchema?: Schema } - export interface IP { /** * ID of the IP. @@ -263,7 +229,6 @@ export interface IP { reverseStatusMessage: string } - export interface ServerInstall { /** * ID of the OS. @@ -299,7 +264,6 @@ export interface ServerInstall { partitioningSchema?: Schema } - export interface ServerOption { /** * ID of the option. @@ -353,7 +317,6 @@ export interface ServerOption { certification?: CertificationOption } - export interface ServerRescueServer { /** * Rescue user name. @@ -365,14 +328,12 @@ export interface ServerRescueServer { password: string } - export interface OSOSField { editable: boolean required: boolean defaultValue?: string } - export interface CPU { /** * Name of the CPU. @@ -396,7 +357,6 @@ export interface CPU { benchmark: string } - export interface Disk { /** * Capacity of the disk in bytes. @@ -408,7 +368,6 @@ export interface Disk { type: string } - export interface GPU { /** * Name of the GPU. @@ -420,7 +379,6 @@ export interface GPU { vram: number } - export interface Memory { /** * Capacity of the memory in bytes. @@ -440,7 +398,6 @@ export interface Memory { isEcc: boolean } - export interface OfferOptionOffer { /** * ID of the option. @@ -503,7 +460,6 @@ If false the option is available for the offer but not included by default. certification?: CertificationOption } - export interface PersistentMemory { /** * Capacity of the memory in bytes. @@ -519,13 +475,11 @@ export interface PersistentMemory { frequency: number } - export interface RaidController { model: string raidLevel: string[] } - export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -577,7 +531,6 @@ export type CreateServerRequest = { userData?: string } - export interface Server { /** * ID of the server. @@ -665,7 +618,6 @@ export interface Server { userData?: string } - export interface OS { /** * ID of the OS. @@ -733,7 +685,6 @@ export interface OS { zone: ScwZone } - export interface Offer { /** * ID of the offer. @@ -841,7 +792,6 @@ export interface Offer { zone: ScwZone } - export interface Option { /** * ID of the option. @@ -887,7 +837,6 @@ export interface Option { certification?: CertificationOption } - export interface ServerEvent { /** * ID of the server to which the action will be applied. @@ -907,7 +856,6 @@ export interface ServerEvent { createdAt?: Date } - export interface ServerPrivateNetwork { /** * The Private Network ID. @@ -943,7 +891,6 @@ export interface ServerPrivateNetwork { updatedAt?: Date } - export interface Setting { /** * ID of the setting. @@ -963,7 +910,6 @@ export interface Setting { enabled: boolean } - export type AddOptionServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -983,7 +929,6 @@ export type AddOptionServerRequest = { expiresAt?: Date } - export interface BMCAccess { /** * URL to access to the server console. @@ -1003,7 +948,6 @@ export interface BMCAccess { expiresAt?: Date } - export type DeleteOptionServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1019,7 +963,6 @@ export type DeleteOptionServerRequest = { optionId: string } - export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1031,7 +974,6 @@ export type DeleteServerRequest = { serverId: string } - export type GetBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1043,7 +985,6 @@ export type GetBMCAccessRequest = { serverId: string } - export type GetDefaultPartitioningSchemaRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1059,7 +1000,6 @@ export type GetDefaultPartitioningSchemaRequest = { osId: string } - export type GetOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1071,7 +1011,6 @@ export type GetOSRequest = { osId: string } - export type GetOfferRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1083,7 +1022,6 @@ export type GetOfferRequest = { offerId: string } - export type GetOptionRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1095,7 +1033,6 @@ export type GetOptionRequest = { optionId: string } - export type GetServerMetricsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1107,7 +1044,6 @@ export type GetServerMetricsRequest = { serverId: string } - export interface GetServerMetricsResponse { /** * Timeseries object representing pings on the server. @@ -1115,7 +1051,6 @@ export interface GetServerMetricsResponse { pings?: TimeSeries } - export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1127,7 +1062,6 @@ export type GetServerRequest = { serverId: string } - export type InstallServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1175,7 +1109,6 @@ export type InstallServerRequest = { userData?: Blob } - export type ListOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1195,7 +1128,6 @@ export type ListOSRequest = { offerId?: string } - export interface ListOSResponse { /** * Total count of matching OS. @@ -1207,7 +1139,6 @@ export interface ListOSResponse { os: OS[] } - export type ListOffersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1231,7 +1162,6 @@ export type ListOffersRequest = { name?: string } - export interface ListOffersResponse { /** * Total count of matching offers. @@ -1243,7 +1173,6 @@ export interface ListOffersResponse { offers: Offer[] } - export type ListOptionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1267,7 +1196,6 @@ export type ListOptionsRequest = { name?: string } - export interface ListOptionsResponse { /** * Total count of matching options. @@ -1279,7 +1207,6 @@ export interface ListOptionsResponse { options: Option[] } - export type ListServerEventsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1303,7 +1230,6 @@ export type ListServerEventsRequest = { orderBy?: ListServerEventsRequestOrderBy } - export interface ListServerEventsResponse { /** * Total count of matching events. @@ -1315,13 +1241,11 @@ export interface ListServerEventsResponse { events: ServerEvent[] } - export interface ListServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] totalCount: number } - export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1365,7 +1289,6 @@ export type ListServersRequest = { optionId?: string } - export interface ListServersResponse { /** * Total count of matching servers. @@ -1377,7 +1300,6 @@ export interface ListServersResponse { servers: Server[] } - export type ListSettingsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1401,7 +1323,6 @@ export type ListSettingsRequest = { projectId?: string } - export interface ListSettingsResponse { /** * Total count of matching settings. @@ -1413,7 +1334,6 @@ export interface ListSettingsResponse { settings: Setting[] } - export type MigrateServerToMonthlyOfferRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1425,7 +1345,6 @@ export type MigrateServerToMonthlyOfferRequest = { serverId: string } - export type PrivateNetworkApiAddServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1441,7 +1360,6 @@ export type PrivateNetworkApiAddServerPrivateNetworkRequest = { privateNetworkId: string } - export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1457,7 +1375,6 @@ export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { privateNetworkId: string } - export type PrivateNetworkApiListServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1493,7 +1410,6 @@ export type PrivateNetworkApiListServerPrivateNetworksRequest = { projectId?: string } - export type PrivateNetworkApiSetServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1509,7 +1425,6 @@ export type PrivateNetworkApiSetServerPrivateNetworksRequest = { privateNetworkIds: string[] } - export type RebootServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1529,12 +1444,10 @@ export type RebootServerRequest = { sshKeyIds?: string[] } - export interface SetServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] } - export type StartBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1550,7 +1463,6 @@ export type StartBMCAccessRequest = { ip: string } - export type StartServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1570,7 +1482,6 @@ export type StartServerRequest = { sshKeyIds?: string[] } - export type StopBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1582,7 +1493,6 @@ export type StopBMCAccessRequest = { serverId: string } - export type StopServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1594,7 +1504,6 @@ export type StopServerRequest = { serverId: string } - export type UpdateIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1614,7 +1523,6 @@ export type UpdateIPRequest = { reverse?: string } - export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1646,7 +1554,6 @@ export type UpdateServerRequest = { userData?: string } - export type UpdateSettingRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1662,7 +1569,6 @@ export type UpdateSettingRequest = { enabled?: boolean } - export type ValidatePartitioningSchemaRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1681,5 +1587,3 @@ export type ValidatePartitioningSchemaRequest = { */ osId: string } - - diff --git a/packages_generated/baremetal/src/v3/api.gen.ts b/packages_generated/baremetal/src/v3/api.gen.ts index a24d3b59f..01103f51d 100644 --- a/packages_generated/baremetal/src/v3/api.gen.ts +++ b/packages_generated/baremetal/src/v3/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { unmarshalListServerPrivateNetworksResponse, marshalPrivateNetworkApiAddServerPrivateNetworkRequest, @@ -37,29 +37,33 @@ export class PrivateNetworkAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + /** * Add a server to a Private Network. Add an Elastic Metal server to a Private Network. * * @param request - The request {@link PrivateNetworkApiAddServerPrivateNetworkRequest} * @returns A Promise of ServerPrivateNetwork */ - addServerPrivateNetwork = (request: Readonly) => + addServerPrivateNetwork = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiAddServerPrivateNetworkRequest(request, this.client.settings), + marshalPrivateNetworkApiAddServerPrivateNetworkRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -68,18 +72,22 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalServerPrivateNetwork, ) - /** * Set multiple Private Networks on a server. Configure multiple Private Networks on an Elastic Metal server. * * @param request - The request {@link PrivateNetworkApiSetServerPrivateNetworksRequest} * @returns A Promise of SetServerPrivateNetworksResponse */ - setServerPrivateNetworks = (request: Readonly) => + setServerPrivateNetworks = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalPrivateNetworkApiSetServerPrivateNetworksRequest(request, this.client.settings), + marshalPrivateNetworkApiSetServerPrivateNetworksRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -88,8 +96,9 @@ export class PrivateNetworkAPI extends ParentAPI { unmarshalSetServerPrivateNetworksResponse, ) - - protected pageOfListServerPrivateNetworks = (request: Readonly = {}) => + protected pageOfListServerPrivateNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -99,7 +108,10 @@ export class PrivateNetworkAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['server_id', request.serverId], @@ -107,30 +119,32 @@ export class PrivateNetworkAPI extends ParentAPI { }, unmarshalListServerPrivateNetworksResponse, ) - + /** * List the Private Networks of a server. List the Private Networks of an Elastic Metal server. * * @param request - The request {@link PrivateNetworkApiListServerPrivateNetworksRequest} * @returns A Promise of ListServerPrivateNetworksResponse */ - listServerPrivateNetworks = (request: Readonly = {}) => - enrichForPagination('serverPrivateNetworks', this.pageOfListServerPrivateNetworks, request) + listServerPrivateNetworks = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'serverPrivateNetworks', + this.pageOfListServerPrivateNetworks, + request, + ) - /** * Delete a Private Network. * * @param request - The request {@link PrivateNetworkApiDeleteServerPrivateNetworkRequest} */ - deleteServerPrivateNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/baremetal/v3/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }, - ) - - + deleteServerPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/baremetal/v3/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }) } - diff --git a/packages_generated/baremetal/src/v3/content.gen.ts b/packages_generated/baremetal/src/v3/content.gen.ts index 62df7d915..1c5a0149e 100644 --- a/packages_generated/baremetal/src/v3/content.gen.ts +++ b/packages_generated/baremetal/src/v3/content.gen.ts @@ -1,13 +1,7 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - ServerPrivateNetworkStatus, -} from './types.gen.js' - +import type { ServerPrivateNetworkStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */ -export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = [ - 'attaching', - 'detaching', -] - +export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] = + ['attaching', 'detaching'] diff --git a/packages_generated/baremetal/src/v3/index.gen.ts b/packages_generated/baremetal/src/v3/index.gen.ts index 6c658de0c..dfd59465d 100644 --- a/packages_generated/baremetal/src/v3/index.gen.ts +++ b/packages_generated/baremetal/src/v3/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - PrivateNetworkAPI, -} from './api.gen.js' +export { PrivateNetworkAPI } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/baremetal/src/v3/marshalling.gen.ts b/packages_generated/baremetal/src/v3/marshalling.gen.ts index 784b9bb06..8aa6d1b91 100644 --- a/packages_generated/baremetal/src/v3/marshalling.gen.ts +++ b/packages_generated/baremetal/src/v3/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ServerPrivateNetwork, @@ -9,7 +12,9 @@ import type { PrivateNetworkApiSetServerPrivateNetworksRequest, } from './types.gen.js' -export const unmarshalServerPrivateNetwork = (data: unknown): ServerPrivateNetwork => { +export const unmarshalServerPrivateNetwork = ( + data: unknown, +): ServerPrivateNetwork => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerPrivateNetwork' failed as data isn't a dictionary.`, @@ -29,7 +34,9 @@ export const unmarshalServerPrivateNetwork = (data: unknown): ServerPrivateNetwo } as ServerPrivateNetwork } -export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListServerPrivateNetworksResponse => { +export const unmarshalListServerPrivateNetworksResponse = ( + data: unknown, +): ListServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -37,12 +44,17 @@ export const unmarshalListServerPrivateNetworksResponse = (data: unknown): ListS } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), totalCount: data.total_count, } as ListServerPrivateNetworksResponse } -export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetServerPrivateNetworksResponse => { +export const unmarshalSetServerPrivateNetworksResponse = ( + data: unknown, +): SetServerPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -50,7 +62,10 @@ export const unmarshalSetServerPrivateNetworksResponse = (data: unknown): SetSer } return { - serverPrivateNetworks: unmarshalArrayOfObject(data.server_private_networks, unmarshalServerPrivateNetwork), + serverPrivateNetworks: unmarshalArrayOfObject( + data.server_private_networks, + unmarshalServerPrivateNetwork, + ), } as SetServerPrivateNetworksResponse } @@ -66,5 +81,5 @@ export const marshalPrivateNetworkApiSetServerPrivateNetworksRequest = ( request: PrivateNetworkApiSetServerPrivateNetworksRequest, defaults: DefaultValues, ): Record => ({ - per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, + per_private_network_ipam_ip_ids: request.perPrivateNetworkIpamIpIds, }) diff --git a/packages_generated/baremetal/src/v3/types.gen.ts b/packages_generated/baremetal/src/v3/types.gen.ts index 701339ee5..bfdd5f980 100644 --- a/packages_generated/baremetal/src/v3/types.gen.ts +++ b/packages_generated/baremetal/src/v3/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Zone as ScwZone } from '@scaleway/sdk-client' export type ListServerPrivateNetworksRequestOrderBy = | 'created_at_asc' @@ -56,13 +55,11 @@ export interface ServerPrivateNetwork { ipamIpIds: string[] } - export interface ListServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] totalCount: number } - export type PrivateNetworkApiAddServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -82,7 +79,6 @@ export type PrivateNetworkApiAddServerPrivateNetworkRequest = { ipamIpIds?: string[] } - export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -98,7 +94,6 @@ export type PrivateNetworkApiDeleteServerPrivateNetworkRequest = { privateNetworkId: string } - export type PrivateNetworkApiListServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -138,7 +133,6 @@ export type PrivateNetworkApiListServerPrivateNetworksRequest = { ipamIpIds?: string[] } - export type PrivateNetworkApiSetServerPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -154,9 +148,6 @@ export type PrivateNetworkApiSetServerPrivateNetworksRequest = { perPrivateNetworkIpamIpIds: Record } - export interface SetServerPrivateNetworksResponse { serverPrivateNetworks: ServerPrivateNetwork[] } - - diff --git a/packages_generated/billing/src/v2beta1/api.gen.ts b/packages_generated/billing/src/v2beta1/api.gen.ts index d47e82e12..3c1b678ad 100644 --- a/packages_generated/billing/src/v2beta1/api.gen.ts +++ b/packages_generated/billing/src/v2beta1/api.gen.ts @@ -38,7 +38,9 @@ import type { This API allows you to manage and query your Scaleway billing and consumption. */ export class API extends ParentAPI { - protected pageOfListConsumptions = (request: Readonly = {}) => + protected pageOfListConsumptions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -48,20 +50,29 @@ export class API extends ParentAPI { ['category_name', request.categoryName], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ...Object.entries(resolveOneOf([ - {default: this.client.settings.defaultOrganizationId,param: 'organization_id', - value: request.organizationId, - }, - {default: this.client.settings.defaultProjectId,param: 'project_id', - value: request.projectId, - }, - ])), + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ...Object.entries( + resolveOneOf([ + { + default: this.client.settings.defaultOrganizationId, + param: 'organization_id', + value: request.organizationId, + }, + { + default: this.client.settings.defaultProjectId, + param: 'project_id', + value: request.projectId, + }, + ]), + ), ), }, unmarshalListConsumptionsResponse, ) - + /** * Get monthly consumption. Consumption allows you to retrieve your past or current consumption cost, by project or category. * @@ -71,7 +82,6 @@ export class API extends ParentAPI { listConsumptions = (request: Readonly = {}) => enrichForPagination('consumptions', this.pageOfListConsumptions, request) - protected pageOfListTaxes = (request: Readonly = {}) => this.client.fetch( { @@ -80,14 +90,21 @@ export class API extends ParentAPI { urlParams: urlParams( ['billing_period', request.billingPeriod], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListTaxesResponse, ) - + /** * Get monthly consumption taxes. Consumption Tax allows you to retrieve your past or current tax charges, by project or category. * @@ -97,8 +114,9 @@ export class API extends ParentAPI { listTaxes = (request: Readonly = {}) => enrichForPagination('taxes', this.pageOfListTaxes, request) - - protected pageOfListInvoices = (request: Readonly = {}) => + protected pageOfListInvoices = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -110,12 +128,15 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInvoicesResponse, ) - + /** * List invoices. List all your invoices, filtering by `start_date` and `invoice_type`. Each invoice has its own ID. * @@ -125,7 +146,6 @@ export class API extends ParentAPI { listInvoices = (request: Readonly = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request) - /** * Export invoices. Export invoices in a CSV file. * @@ -133,26 +153,23 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ exportInvoices = (request: Readonly = {}) => - this.client.fetch( - { - method: 'GET', - path: `/billing/v2beta1/export-invoices`, - urlParams: urlParams( - ['dl', 1], - ['billing_period_start_after', request.billingPeriodStartAfter], - ['billing_period_start_before', request.billingPeriodStartBefore], - ['file_type', request.fileType], - ['invoice_type', request.invoiceType], - ['order_by', request.orderBy], - ['organization_id', request.organizationId], - ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/billing/v2beta1/export-invoices`, + urlParams: urlParams( + ['dl', 1], + ['billing_period_start_after', request.billingPeriodStartAfter], + ['billing_period_start_before', request.billingPeriodStartBefore], + ['file_type', request.fileType], + ['invoice_type', request.invoiceType], + ['order_by', request.orderBy], + ['organization_id', request.organizationId], + ['page', request.page], + ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + ), + responseType: 'blob', + }) - /** * Get an invoice. Get a specific invoice, specified by its ID. * @@ -168,7 +185,6 @@ export class API extends ParentAPI { unmarshalInvoice, ) - /** * Download an invoice. Download a specific invoice, specified by its ID. * @@ -176,20 +192,16 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ downloadInvoice = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/billing/v2beta1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`, - urlParams: urlParams( - ['dl', 1], - ['file_type', request.fileType], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/billing/v2beta1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`, + urlParams: urlParams(['dl', 1], ['file_type', request.fileType]), + responseType: 'blob', + }) - - protected pageOfListDiscounts = (request: Readonly = {}) => + protected pageOfListDiscounts = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -198,12 +210,15 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDiscountsResponse, ) - + /** * List discounts. List all discounts for your Organization and usable categories, products, offers, references, regions and zones where the discount can be applied. As a reseller: - If you do not specify an `organization_id` you will list the discounts applied to your own Organization and your customers @@ -216,7 +231,6 @@ export class API extends ParentAPI { listDiscounts = (request: Readonly = {}) => enrichForPagination('discounts', this.pageOfListDiscounts, request) - /** * Redeem coupon. Redeem a coupon given the related code. * @@ -230,12 +244,13 @@ export class API extends ParentAPI { path: `/billing/v2beta1/redeem-coupon`, urlParams: urlParams( ['code', request.code], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ), }, unmarshalDiscount, ) - - } - diff --git a/packages_generated/billing/src/v2beta1/index.gen.ts b/packages_generated/billing/src/v2beta1/index.gen.ts index 7643dda7e..13fdfc316 100644 --- a/packages_generated/billing/src/v2beta1/index.gen.ts +++ b/packages_generated/billing/src/v2beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { Discount, diff --git a/packages_generated/billing/src/v2beta1/marshalling.gen.ts b/packages_generated/billing/src/v2beta1/marshalling.gen.ts index 2e7ec46ce..58eff780e 100644 --- a/packages_generated/billing/src/v2beta1/marshalling.gen.ts +++ b/packages_generated/billing/src/v2beta1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DiscountCoupon, DiscountFilter, @@ -81,16 +85,24 @@ export const unmarshalInvoice = (data: unknown): Invoice => { startDate: unmarshalDate(data.start_date), state: data.state, stopDate: unmarshalDate(data.stop_date), - totalDiscount: data.total_discount ? unmarshalMoney(data.total_discount) : undefined, + totalDiscount: data.total_discount + ? unmarshalMoney(data.total_discount) + : undefined, totalTax: data.total_tax ? unmarshalMoney(data.total_tax) : undefined, totalTaxed: data.total_taxed ? unmarshalMoney(data.total_taxed) : undefined, - totalUndiscount: data.total_undiscount ? unmarshalMoney(data.total_undiscount) : undefined, - totalUntaxed: data.total_untaxed ? unmarshalMoney(data.total_untaxed) : undefined, + totalUndiscount: data.total_undiscount + ? unmarshalMoney(data.total_undiscount) + : undefined, + totalUntaxed: data.total_untaxed + ? unmarshalMoney(data.total_untaxed) + : undefined, type: data.type, } as Invoice } -const unmarshalListConsumptionsResponseConsumption = (data: unknown): ListConsumptionsResponseConsumption => { +const unmarshalListConsumptionsResponseConsumption = ( + data: unknown, +): ListConsumptionsResponseConsumption => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListConsumptionsResponseConsumption' failed as data isn't a dictionary.`, @@ -110,7 +122,9 @@ const unmarshalListConsumptionsResponseConsumption = (data: unknown): ListConsum } as ListConsumptionsResponseConsumption } -export const unmarshalListConsumptionsResponse = (data: unknown): ListConsumptionsResponse => { +export const unmarshalListConsumptionsResponse = ( + data: unknown, +): ListConsumptionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListConsumptionsResponse' failed as data isn't a dictionary.`, @@ -118,14 +132,19 @@ export const unmarshalListConsumptionsResponse = (data: unknown): ListConsumptio } return { - consumptions: unmarshalArrayOfObject(data.consumptions, unmarshalListConsumptionsResponseConsumption), + consumptions: unmarshalArrayOfObject( + data.consumptions, + unmarshalListConsumptionsResponseConsumption, + ), totalCount: data.total_count, totalDiscountUntaxedValue: data.total_discount_untaxed_value, updatedAt: unmarshalDate(data.updated_at), } as ListConsumptionsResponse } -export const unmarshalListDiscountsResponse = (data: unknown): ListDiscountsResponse => { +export const unmarshalListDiscountsResponse = ( + data: unknown, +): ListDiscountsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDiscountsResponse' failed as data isn't a dictionary.`, @@ -138,7 +157,9 @@ export const unmarshalListDiscountsResponse = (data: unknown): ListDiscountsResp } as ListDiscountsResponse } -export const unmarshalListInvoicesResponse = (data: unknown): ListInvoicesResponse => { +export const unmarshalListInvoicesResponse = ( + data: unknown, +): ListInvoicesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`, @@ -166,7 +187,9 @@ const unmarshalListTaxesResponseTax = (data: unknown): ListTaxesResponseTax => { } as ListTaxesResponseTax } -export const unmarshalListTaxesResponse = (data: unknown): ListTaxesResponse => { +export const unmarshalListTaxesResponse = ( + data: unknown, +): ListTaxesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTaxesResponse' failed as data isn't a dictionary.`, diff --git a/packages_generated/billing/src/v2beta1/types.gen.ts b/packages_generated/billing/src/v2beta1/types.gen.ts index 5ccd894c2..c952c03e0 100644 --- a/packages_generated/billing/src/v2beta1/types.gen.ts +++ b/packages_generated/billing/src/v2beta1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, } from '@scaleway/sdk-client' - +import type { Money } from '@scaleway/sdk-client' export type DiscountDiscountMode = | 'unknown_discount_mode' @@ -18,11 +17,9 @@ export type DiscountFilterType = | 'region' | 'zone' -export type DownloadInvoiceRequestFileType = - | 'pdf' +export type DownloadInvoiceRequestFileType = 'pdf' -export type ExportInvoicesRequestFileType = - | 'csv' +export type ExportInvoicesRequestFileType = 'csv' export type ExportInvoicesRequestOrderBy = | 'invoice_number_desc' @@ -40,10 +37,7 @@ export type ExportInvoicesRequestOrderBy = | 'invoice_type_desc' | 'invoice_type_asc' -export type InvoiceType = - | 'unknown_type' - | 'periodic' - | 'purchase' +export type InvoiceType = 'unknown_type' | 'periodic' | 'purchase' export type ListConsumptionsRequestOrderBy = | 'updated_at_desc' @@ -88,7 +82,6 @@ export interface DiscountCoupon { description?: string } - export interface DiscountFilter { /** * Type of the filter (category name, product name, product range, resource name, region or zone). @@ -104,7 +97,6 @@ export interface DiscountFilter { exclude: boolean } - export interface ListConsumptionsResponseConsumption { /** * Monetary value of the consumption. @@ -144,7 +136,6 @@ export interface ListConsumptionsResponseConsumption { consumerId: string } - export interface Discount { /** * The ID of the discount. @@ -196,7 +187,6 @@ export interface Discount { filters: DiscountFilter[] } - export interface Invoice { /** * Invoice ID. @@ -259,7 +249,6 @@ export interface Invoice { sellerName: string } - export interface ListTaxesResponseTax { /** * Description of the tax applied. @@ -279,7 +268,6 @@ export interface ListTaxesResponseTax { totalTaxValue?: number } - export type DownloadInvoiceRequest = { /** * Invoice ID. @@ -291,7 +279,6 @@ export type DownloadInvoiceRequest = { fileType?: DownloadInvoiceRequestFileType } - export type ExportInvoicesRequest = { /** * Organization ID. If specified, only invoices from this Organization will be returned. @@ -327,7 +314,6 @@ export type ExportInvoicesRequest = { fileType?: ExportInvoicesRequestFileType } - export type GetInvoiceRequest = { /** * Invoice ID. @@ -335,7 +321,6 @@ export type GetInvoiceRequest = { invoiceId: string } - export type ListConsumptionsRequest = { /** * Order consumptions list in the response by their update date. @@ -371,7 +356,6 @@ export type ListConsumptionsRequest = { billingPeriod?: string } - export interface ListConsumptionsResponse { /** * Detailed consumption list. @@ -391,7 +375,6 @@ export interface ListConsumptionsResponse { updatedAt?: Date } - export type ListDiscountsRequest = { /** * Order discounts in the response by their description. @@ -411,7 +394,6 @@ export type ListDiscountsRequest = { organizationId?: string } - export interface ListDiscountsResponse { /** * Total number of discounts. @@ -423,7 +405,6 @@ export interface ListDiscountsResponse { discounts: Discount[] } - export type ListInvoicesRequest = { /** * Organization ID. If specified, only invoices from this Organization will be returned. @@ -455,7 +436,6 @@ export type ListInvoicesRequest = { orderBy?: ListInvoicesRequestOrderBy } - export interface ListInvoicesResponse { /** * Total number of invoices. @@ -467,7 +447,6 @@ export interface ListInvoicesResponse { invoices: Invoice[] } - export type ListTaxesRequest = { /** * Order consumed taxes list in the response by their update date. @@ -491,7 +470,6 @@ export type ListTaxesRequest = { billingPeriod?: string } - export interface ListTaxesResponse { /** * Detailed consumption tax. @@ -507,7 +485,6 @@ export interface ListTaxesResponse { updatedAt?: Date } - export type RedeemCouponRequest = { /** * The Organization ID of the discount. @@ -518,5 +495,3 @@ export type RedeemCouponRequest = { */ code: string } - - diff --git a/packages_generated/block/src/v1/api.gen.ts b/packages_generated/block/src/v1/api.gen.ts index 9222a1ffa..802539ac5 100644 --- a/packages_generated/block/src/v1/api.gen.ts +++ b/packages_generated/block/src/v1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK,VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK, + VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK, +} from './content.gen.js' import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, @@ -58,34 +61,38 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'fr-par-3', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - - protected pageOfListVolumeTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'fr-par-3', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + + protected pageOfListVolumeTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/block/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volume-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListVolumeTypesResponse, ) - + /** * List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. * @@ -95,7 +102,6 @@ export class API extends ParentAPI { listVolumeTypes = (request: Readonly = {}) => enrichForPagination('volumeTypes', this.pageOfListVolumeTypes, request) - protected pageOfListVolumes = (request: Readonly) => this.client.fetch( { @@ -107,7 +113,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['product_resource_id', request.productResourceId], ['project_id', request.projectId], ['tags', request.tags], @@ -116,7 +125,7 @@ export class API extends ParentAPI { }, unmarshalListVolumesResponse, ) - + /** * List volumes. List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. * @@ -126,7 +135,6 @@ export class API extends ParentAPI { listVolumes = (request: Readonly) => enrichForPagination('volumes', this.pageOfListVolumes, request) - /** * Create a volume. To create a new volume from scratch, you must specify `from_empty` and the `size`. To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot. @@ -147,7 +155,6 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s unmarshalVolume, ) - /** * Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. * @@ -162,7 +169,7 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s }, unmarshalVolume, ) - + /** * Waits for {@link Volume} to be in a final state. * @@ -175,27 +182,27 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!VOLUME_TRANSIENT_STATUSES_BLOCK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !VOLUME_TRANSIENT_STATUSES_BLOCK.includes(res.status), + )), this.getVolume, request, options, ) - /** * Delete a detached volume. You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status. * * @param request - The request {@link DeleteVolumeRequest} */ deleteVolume = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/block/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/block/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, + }) - /** * Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class. @@ -216,7 +223,6 @@ You can only resize a volume to a larger size. It is currently not possible to c unmarshalVolume, ) - protected pageOfListSnapshots = (request: Readonly) => this.client.fetch( { @@ -228,7 +234,10 @@ You can only resize a volume to a larger size. It is currently not possible to c ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ['volume_id', request.volumeId], @@ -236,7 +245,7 @@ You can only resize a volume to a larger size. It is currently not possible to c }, unmarshalListSnapshotsResponse, ) - + /** * List all snapshots. List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. * @@ -246,7 +255,6 @@ You can only resize a volume to a larger size. It is currently not possible to c listSnapshots = (request: Readonly) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. * @@ -261,7 +269,7 @@ You can only resize a volume to a larger size. It is currently not possible to c }, unmarshalSnapshot, ) - + /** * Waits for {@link Snapshot} to be in a final state. * @@ -274,13 +282,16 @@ You can only resize a volume to a larger size. It is currently not possible to c options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES_BLOCK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SNAPSHOT_TRANSIENT_STATUSES_BLOCK.includes(res.status), + )), this.getSnapshot, request, options, ) - /** * Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status. If your volume is in a transient state, you need to wait until the end of the current operation. @@ -301,7 +312,6 @@ If your volume is in a transient state, you need to wait until the end of the cu unmarshalSnapshot, ) - /** * Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket. @@ -309,11 +319,16 @@ The bucket can be imported into any Availability Zone as long as it is in the sa * @param request - The request {@link ImportSnapshotFromObjectStorageRequest} * @returns A Promise of Snapshot */ - importSnapshotFromObjectStorage = (request: Readonly) => + importSnapshotFromObjectStorage = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings), + marshalImportSnapshotFromObjectStorageRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -322,7 +337,6 @@ The bucket can be imported into any Availability Zone as long as it is in the sa unmarshalSnapshot, ) - /** * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format. The snapshot must not be in transient state. @@ -330,11 +344,16 @@ The snapshot must not be in transient state. * @param request - The request {@link ExportSnapshotToObjectStorageRequest} * @returns A Promise of Snapshot */ - exportSnapshotToObjectStorage = (request: Readonly) => + exportSnapshotToObjectStorage = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalExportSnapshotToObjectStorageRequest(request, this.client.settings), + marshalExportSnapshotToObjectStorageRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -343,21 +362,17 @@ The snapshot must not be in transient state. unmarshalSnapshot, ) - /** * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use. * * @param request - The request {@link DeleteSnapshotRequest} */ deleteSnapshot = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/block/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/block/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, + }) - /** * Update a snapshot. Update the name or tags of the snapshot. * @@ -376,7 +391,4 @@ The snapshot must not be in transient state. }, unmarshalSnapshot, ) - - } - diff --git a/packages_generated/block/src/v1/content.gen.ts b/packages_generated/block/src/v1/content.gen.ts index 4e5866d70..843940551 100644 --- a/packages_generated/block/src/v1/content.gen.ts +++ b/packages_generated/block/src/v1/content.gen.ts @@ -6,7 +6,6 @@ import type { VolumeStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link ReferenceStatus}. */ export const REFERENCE_TRANSIENT_STATUSES: ReferenceStatus[] = [ 'attaching', @@ -29,4 +28,3 @@ export const VOLUME_TRANSIENT_STATUSES: VolumeStatus[] = [ 'snapshotting', 'updating', ] - diff --git a/packages_generated/block/src/v1/index.gen.ts b/packages_generated/block/src/v1/index.gen.ts index 82396f7cb..609902d10 100644 --- a/packages_generated/block/src/v1/index.gen.ts +++ b/packages_generated/block/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/block/src/v1/marshalling.gen.ts b/packages_generated/block/src/v1/marshalling.gen.ts index 151126958..c4e32ac37 100644 --- a/packages_generated/block/src/v1/marshalling.gen.ts +++ b/packages_generated/block/src/v1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Reference, @@ -67,7 +73,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => { createdAt: unmarshalDate(data.created_at), id: data.id, name: data.name, - parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined, + parentVolume: data.parent_volume + ? unmarshalSnapshotParentVolume(data.parent_volume) + : undefined, projectId: data.project_id, references: unmarshalArrayOfObject(data.references, unmarshalReference), size: data.size, @@ -116,7 +124,9 @@ export const unmarshalVolume = (data: unknown): Volume => { } as Volume } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -138,13 +148,17 @@ const unmarshalVolumeType = (data: unknown): VolumeType => { return { pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined, - snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : undefined, + snapshotPricing: data.snapshot_pricing + ? unmarshalMoney(data.snapshot_pricing) + : undefined, specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined, type: data.type, } as VolumeType } -export const unmarshalListVolumeTypesResponse = (data: unknown): ListVolumeTypesResponse => { +export const unmarshalListVolumeTypesResponse = ( + data: unknown, +): ListVolumeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`, @@ -157,7 +171,9 @@ export const unmarshalListVolumeTypesResponse = (data: unknown): ListVolumeTypes } as ListVolumeTypesResponse } -export const unmarshalListVolumesResponse = (data: unknown): ListVolumesResponse => { +export const unmarshalListVolumesResponse = ( + data: unknown, +): ListVolumesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`, @@ -201,22 +217,27 @@ export const marshalCreateVolumeRequest = ( ): Record => ({ name: request.name || randomName('vol'), project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {param: 'from_empty', - value: (request.fromEmpty !== undefined) ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty, defaults) - : undefined, + { + param: 'from_empty', + value: + request.fromEmpty !== undefined + ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty, defaults) + : undefined, }, - {param: 'from_snapshot', - value: (request.fromSnapshot !== undefined) ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot, defaults) - : undefined, - }, - ]), - ...resolveOneOf([ - {param: 'perf_iops', - value: request.perfIops, + { + param: 'from_snapshot', + value: + request.fromSnapshot !== undefined + ? marshalCreateVolumeRequestFromSnapshot( + request.fromSnapshot, + defaults, + ) + : undefined, }, ]), + ...resolveOneOf([{ param: 'perf_iops', value: request.perfIops }]), }) export const marshalExportSnapshotToObjectStorageRequest = ( diff --git a/packages_generated/block/src/v1/types.gen.ts b/packages_generated/block/src/v1/types.gen.ts index 8f28898eb..9e4b27cca 100644 --- a/packages_generated/block/src/v1/types.gen.ts +++ b/packages_generated/block/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Money, Zone as ScwZone } from '@scaleway/sdk-client' export type ListSnapshotsRequestOrderBy = | 'created_at_asc' @@ -24,11 +23,7 @@ export type ReferenceStatus = | 'creating' | 'error' -export type ReferenceType = - | 'unknown_type' - | 'link' - | 'exclusive' - | 'read_only' +export type ReferenceType = 'unknown_type' | 'link' | 'exclusive' | 'read_only' export type SnapshotStatus = | 'unknown_status' @@ -87,7 +82,6 @@ export interface Reference { status: ReferenceStatus } - export interface SnapshotParentVolume { /** * Parent volume UUID (volume from which the snapshot originates). @@ -107,7 +101,6 @@ export interface SnapshotParentVolume { status: VolumeStatus } - export interface VolumeSpecifications { /** * The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`). @@ -119,7 +112,6 @@ export interface VolumeSpecifications { class: StorageClass } - export interface CreateVolumeRequestFromEmpty { /** * Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size. @@ -127,7 +119,6 @@ export interface CreateVolumeRequestFromEmpty { size: number } - export interface CreateVolumeRequestFromSnapshot { /** * Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size. @@ -140,7 +131,6 @@ Size is optional and is used only if a resize of the volume is requested, otherw snapshotId: string } - export interface Snapshot { /** * UUID of the snapshot. @@ -192,7 +182,6 @@ export interface Snapshot { class: StorageClass } - export interface VolumeType { /** * Volume type. @@ -212,7 +201,6 @@ export interface VolumeType { specs?: VolumeSpecifications } - export interface Volume { /** * UUID of the volume. @@ -272,7 +260,6 @@ export interface Volume { lastDetachedAt?: Date } - export type CreateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -296,7 +283,6 @@ export type CreateSnapshotRequest = { tags?: string[] } - export type CreateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -334,7 +320,6 @@ export type CreateVolumeRequest = { tags?: string[] } - export type DeleteSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -346,7 +331,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -358,7 +342,6 @@ export type DeleteVolumeRequest = { volumeId: string } - export type ExportSnapshotToObjectStorageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -378,7 +361,6 @@ export type ExportSnapshotToObjectStorageRequest = { key: string } - export type GetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -390,7 +372,6 @@ export type GetSnapshotRequest = { snapshotId: string } - export type GetVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -402,7 +383,6 @@ export type GetVolumeRequest = { volumeId: string } - export type ImportSnapshotFromObjectStorageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -434,7 +414,6 @@ export type ImportSnapshotFromObjectStorageRequest = { size?: number } - export type ListSnapshotsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -478,7 +457,6 @@ export type ListSnapshotsRequest = { includeDeleted: boolean } - export interface ListSnapshotsResponse { /** * Paginated returned list of snapshots. @@ -490,7 +468,6 @@ export interface ListSnapshotsResponse { totalCount: number } - export type ListVolumeTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -506,7 +483,6 @@ export type ListVolumeTypesRequest = { pageSize?: number } - export interface ListVolumeTypesResponse { /** * Returns paginated list of volume-types. @@ -518,7 +494,6 @@ export interface ListVolumeTypesResponse { totalCount: number } - export type ListVolumesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -566,7 +541,6 @@ export type ListVolumesRequest = { volumeType?: string } - export interface ListVolumesResponse { /** * Paginated returned list of volumes. @@ -578,7 +552,6 @@ export interface ListVolumesResponse { totalCount: number } - export type UpdateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -598,7 +571,6 @@ export type UpdateSnapshotRequest = { tags?: string[] } - export type UpdateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -626,5 +598,3 @@ Must be compliant with the minimum (1GB) and maximum (10TB) allowed size. */ perfIops?: number } - - diff --git a/packages_generated/block/src/v1alpha1/api.gen.ts b/packages_generated/block/src/v1alpha1/api.gen.ts index 77cc6802c..794906a16 100644 --- a/packages_generated/block/src/v1alpha1/api.gen.ts +++ b/packages_generated/block/src/v1alpha1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK,VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_BLOCK, + VOLUME_TRANSIENT_STATUSES as VOLUME_TRANSIENT_STATUSES_BLOCK, +} from './content.gen.js' import { marshalCreateSnapshotRequest, marshalCreateVolumeRequest, @@ -60,34 +63,38 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'fr-par-3', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - - protected pageOfListVolumeTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'fr-par-3', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + + protected pageOfListVolumeTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volume-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListVolumeTypesResponse, ) - + /** * List volume types. List all available volume types in a specified zone. The volume types listed are ordered by name in ascending order. * @@ -97,7 +104,6 @@ export class API extends ParentAPI { listVolumeTypes = (request: Readonly = {}) => enrichForPagination('volumeTypes', this.pageOfListVolumeTypes, request) - protected pageOfListVolumes = (request: Readonly = {}) => this.client.fetch( { @@ -108,7 +114,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['product_resource_id', request.productResourceId], ['project_id', request.projectId], ['tags', request.tags], @@ -116,7 +125,7 @@ export class API extends ParentAPI { }, unmarshalListVolumesResponse, ) - + /** * List volumes. List all existing volumes in a specified zone. By default, the volumes listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. * @@ -126,7 +135,6 @@ export class API extends ParentAPI { listVolumes = (request: Readonly = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request) - /** * Create a volume. To create a new volume from scratch, you must specify `from_empty` and the `size`. To create a volume from an existing snapshot, specify `from_snapshot` and the `snapshot_id` in the request payload instead, size is optional and can be specified if you need to extend the original size. The volume will take on the same volume class and underlying IOPS limitations as the original snapshot. @@ -147,7 +155,6 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s unmarshalVolume, ) - /** * Get a volume. Retrieve technical information about a specific volume. Details such as size, type, and status are returned in the response. * @@ -162,7 +169,7 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s }, unmarshalVolume, ) - + /** * Waits for {@link Volume} to be in a final state. * @@ -175,27 +182,27 @@ To create a volume from an existing snapshot, specify `from_snapshot` and the `s options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!VOLUME_TRANSIENT_STATUSES_BLOCK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !VOLUME_TRANSIENT_STATUSES_BLOCK.includes(res.status), + )), this.getVolume, request, options, ) - /** * Delete a detached volume. You must specify the `volume_id` of the volume you want to delete. The volume must not be in the `in_use` status. * * @param request - The request {@link DeleteVolumeRequest} */ deleteVolume = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, + }) - /** * Update a volume. Update the technical details of a volume, such as its name, tags, or its new size and `volume_type` (within the same Block Storage class). You can only resize a volume to a larger size. It is currently not possible to change your Block Storage Class. @@ -216,8 +223,9 @@ You can only resize a volume to a larger size. It is currently not possible to c unmarshalVolume, ) - - protected pageOfListSnapshots = (request: Readonly = {}) => + protected pageOfListSnapshots = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -227,7 +235,10 @@ You can only resize a volume to a larger size. It is currently not possible to c ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ['volume_id', request.volumeId], @@ -235,7 +246,7 @@ You can only resize a volume to a larger size. It is currently not possible to c }, unmarshalListSnapshotsResponse, ) - + /** * List all snapshots. List all available snapshots in a specified zone. By default, the snapshots listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. * @@ -245,7 +256,6 @@ You can only resize a volume to a larger size. It is currently not possible to c listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Get a snapshot. Retrieve technical information about a specific snapshot. Details such as size, volume type, and status are returned in the response. * @@ -260,7 +270,7 @@ You can only resize a volume to a larger size. It is currently not possible to c }, unmarshalSnapshot, ) - + /** * Waits for {@link Snapshot} to be in a final state. * @@ -273,13 +283,16 @@ You can only resize a volume to a larger size. It is currently not possible to c options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES_BLOCK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SNAPSHOT_TRANSIENT_STATUSES_BLOCK.includes(res.status), + )), this.getSnapshot, request, options, ) - /** * Create a snapshot of a volume. To create a snapshot, the volume must be in the `in_use` or the `available` status. If your volume is in a transient state, you need to wait until the end of the current operation. @@ -300,7 +313,6 @@ If your volume is in a transient state, you need to wait until the end of the cu unmarshalSnapshot, ) - /** * (Deprecated in favor of `ImportSnapshotFromObjectStorage`). Import a snapshot from a Scaleway Object Storage bucket The bucket must contain a QCOW2 image. @@ -323,7 +335,6 @@ The bucket can be imported into any Availability Zone as long as it is in the sa unmarshalSnapshot, ) - /** * Import a snapshot from a Scaleway Object Storage bucket. The bucket must contain a QCOW2 image. The bucket can be imported into any Availability Zone as long as it is in the same region as the bucket. @@ -331,11 +342,16 @@ The bucket can be imported into any Availability Zone as long as it is in the sa * @param request - The request {@link ImportSnapshotFromObjectStorageRequest} * @returns A Promise of Snapshot */ - importSnapshotFromObjectStorage = (request: Readonly) => + importSnapshotFromObjectStorage = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalImportSnapshotFromObjectStorageRequest(request, this.client.settings), + marshalImportSnapshotFromObjectStorageRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -344,7 +360,6 @@ The bucket can be imported into any Availability Zone as long as it is in the sa unmarshalSnapshot, ) - /** * Export a snapshot to a Scaleway Object Storage bucket. The snapshot is exported in QCOW2 format. The snapshot must not be in transient state. @@ -352,11 +367,16 @@ The snapshot must not be in transient state. * @param request - The request {@link ExportSnapshotToObjectStorageRequest} * @returns A Promise of Snapshot */ - exportSnapshotToObjectStorage = (request: Readonly) => + exportSnapshotToObjectStorage = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalExportSnapshotToObjectStorageRequest(request, this.client.settings), + marshalExportSnapshotToObjectStorageRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -365,21 +385,17 @@ The snapshot must not be in transient state. unmarshalSnapshot, ) - /** * Delete a snapshot. You must specify the `snapshot_id` of the snapshot you want to delete. The snapshot must not be in use. * * @param request - The request {@link DeleteSnapshotRequest} */ deleteSnapshot = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/block/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, + }) - /** * Update a snapshot. Update the name or tags of the snapshot. * @@ -398,7 +414,4 @@ The snapshot must not be in transient state. }, unmarshalSnapshot, ) - - } - diff --git a/packages_generated/block/src/v1alpha1/content.gen.ts b/packages_generated/block/src/v1alpha1/content.gen.ts index 4e5866d70..843940551 100644 --- a/packages_generated/block/src/v1alpha1/content.gen.ts +++ b/packages_generated/block/src/v1alpha1/content.gen.ts @@ -6,7 +6,6 @@ import type { VolumeStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link ReferenceStatus}. */ export const REFERENCE_TRANSIENT_STATUSES: ReferenceStatus[] = [ 'attaching', @@ -29,4 +28,3 @@ export const VOLUME_TRANSIENT_STATUSES: VolumeStatus[] = [ 'snapshotting', 'updating', ] - diff --git a/packages_generated/block/src/v1alpha1/index.gen.ts b/packages_generated/block/src/v1alpha1/index.gen.ts index b9c9a3238..7fb34d9e5 100644 --- a/packages_generated/block/src/v1alpha1/index.gen.ts +++ b/packages_generated/block/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/block/src/v1alpha1/marshalling.gen.ts b/packages_generated/block/src/v1alpha1/marshalling.gen.ts index c6d1fe5dc..9779a7cf3 100644 --- a/packages_generated/block/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/block/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Reference, @@ -68,7 +74,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => { createdAt: unmarshalDate(data.created_at), id: data.id, name: data.name, - parentVolume: data.parent_volume ? unmarshalSnapshotParentVolume(data.parent_volume) : undefined, + parentVolume: data.parent_volume + ? unmarshalSnapshotParentVolume(data.parent_volume) + : undefined, projectId: data.project_id, references: unmarshalArrayOfObject(data.references, unmarshalReference), size: data.size, @@ -117,7 +125,9 @@ export const unmarshalVolume = (data: unknown): Volume => { } as Volume } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -139,13 +149,17 @@ const unmarshalVolumeType = (data: unknown): VolumeType => { return { pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined, - snapshotPricing: data.snapshot_pricing ? unmarshalMoney(data.snapshot_pricing) : undefined, + snapshotPricing: data.snapshot_pricing + ? unmarshalMoney(data.snapshot_pricing) + : undefined, specs: data.specs ? unmarshalVolumeSpecifications(data.specs) : undefined, type: data.type, } as VolumeType } -export const unmarshalListVolumeTypesResponse = (data: unknown): ListVolumeTypesResponse => { +export const unmarshalListVolumeTypesResponse = ( + data: unknown, +): ListVolumeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumeTypesResponse' failed as data isn't a dictionary.`, @@ -158,7 +172,9 @@ export const unmarshalListVolumeTypesResponse = (data: unknown): ListVolumeTypes } as ListVolumeTypesResponse } -export const unmarshalListVolumesResponse = (data: unknown): ListVolumesResponse => { +export const unmarshalListVolumesResponse = ( + data: unknown, +): ListVolumesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`, @@ -202,22 +218,27 @@ export const marshalCreateVolumeRequest = ( ): Record => ({ name: request.name || randomName('vol'), project_id: request.projectId ?? defaults.defaultProjectId, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {param: 'from_empty', - value: (request.fromEmpty !== undefined) ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty, defaults) - : undefined, + { + param: 'from_empty', + value: + request.fromEmpty !== undefined + ? marshalCreateVolumeRequestFromEmpty(request.fromEmpty, defaults) + : undefined, }, - {param: 'from_snapshot', - value: (request.fromSnapshot !== undefined) ? marshalCreateVolumeRequestFromSnapshot(request.fromSnapshot, defaults) - : undefined, - }, - ]), - ...resolveOneOf([ - {param: 'perf_iops', - value: request.perfIops, + { + param: 'from_snapshot', + value: + request.fromSnapshot !== undefined + ? marshalCreateVolumeRequestFromSnapshot( + request.fromSnapshot, + defaults, + ) + : undefined, }, ]), + ...resolveOneOf([{ param: 'perf_iops', value: request.perfIops }]), }) export const marshalExportSnapshotToObjectStorageRequest = ( diff --git a/packages_generated/block/src/v1alpha1/types.gen.ts b/packages_generated/block/src/v1alpha1/types.gen.ts index 0d9e2d31d..9c0979321 100644 --- a/packages_generated/block/src/v1alpha1/types.gen.ts +++ b/packages_generated/block/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Money, Zone as ScwZone } from '@scaleway/sdk-client' export type ListSnapshotsRequestOrderBy = | 'created_at_asc' @@ -24,11 +23,7 @@ export type ReferenceStatus = | 'creating' | 'error' -export type ReferenceType = - | 'unknown_type' - | 'link' - | 'exclusive' - | 'read_only' +export type ReferenceType = 'unknown_type' | 'link' | 'exclusive' | 'read_only' export type SnapshotStatus = | 'unknown_status' @@ -87,7 +82,6 @@ export interface Reference { status: ReferenceStatus } - export interface SnapshotParentVolume { /** * Parent volume UUID (volume from which the snapshot originates). @@ -107,7 +101,6 @@ export interface SnapshotParentVolume { status: VolumeStatus } - export interface VolumeSpecifications { /** * The maximum IO/s expected, according to the different options available in stock (`5000 | 15000`). @@ -119,7 +112,6 @@ export interface VolumeSpecifications { class: StorageClass } - export interface CreateVolumeRequestFromEmpty { /** * Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size. @@ -127,7 +119,6 @@ export interface CreateVolumeRequestFromEmpty { size: number } - export interface CreateVolumeRequestFromSnapshot { /** * Must be compliant with the minimum (1 GB) and maximum (10 TB) allowed size. @@ -140,7 +131,6 @@ Size is optional and is used only if a resize of the volume is requested, otherw snapshotId: string } - export interface Snapshot { /** * UUID of the snapshot. @@ -192,7 +182,6 @@ export interface Snapshot { class: StorageClass } - export interface VolumeType { /** * Volume type. @@ -212,7 +201,6 @@ export interface VolumeType { specs?: VolumeSpecifications } - export interface Volume { /** * UUID of the volume. @@ -272,7 +260,6 @@ export interface Volume { lastDetachedAt?: Date } - export type CreateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -296,7 +283,6 @@ export type CreateSnapshotRequest = { tags?: string[] } - export type CreateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -334,7 +320,6 @@ export type CreateVolumeRequest = { tags?: string[] } - export type DeleteSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -346,7 +331,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -358,7 +342,6 @@ export type DeleteVolumeRequest = { volumeId: string } - export type ExportSnapshotToObjectStorageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -378,7 +361,6 @@ export type ExportSnapshotToObjectStorageRequest = { key: string } - export type GetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -390,7 +372,6 @@ export type GetSnapshotRequest = { snapshotId: string } - export type GetVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -402,7 +383,6 @@ export type GetVolumeRequest = { volumeId: string } - export type ImportSnapshotFromObjectStorageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -434,7 +414,6 @@ export type ImportSnapshotFromObjectStorageRequest = { size?: number } - export type ImportSnapshotFromS3Request = { /** * Zone to target. If none is passed will use default zone from the config. @@ -466,7 +445,6 @@ export type ImportSnapshotFromS3Request = { size?: number } - export type ListSnapshotsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -506,7 +484,6 @@ export type ListSnapshotsRequest = { tags?: string[] } - export interface ListSnapshotsResponse { /** * Paginated returned list of snapshots. @@ -518,7 +495,6 @@ export interface ListSnapshotsResponse { totalCount: number } - export type ListVolumeTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -534,7 +510,6 @@ export type ListVolumeTypesRequest = { pageSize?: number } - export interface ListVolumeTypesResponse { /** * Returns paginated list of volume-types. @@ -546,7 +521,6 @@ export interface ListVolumeTypesResponse { totalCount: number } - export type ListVolumesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -586,7 +560,6 @@ export type ListVolumesRequest = { tags?: string[] } - export interface ListVolumesResponse { /** * Paginated returned list of volumes. @@ -598,7 +571,6 @@ export interface ListVolumesResponse { totalCount: number } - export type UpdateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -618,7 +590,6 @@ export type UpdateSnapshotRequest = { tags?: string[] } - export type UpdateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -646,5 +617,3 @@ Must be compliant with the minimum (1GB) and maximum (10TB) allowed size. */ perfIops?: number } - - diff --git a/packages_generated/cockpit/src/v1/api.gen.ts b/packages_generated/cockpit/src/v1/api.gen.ts index d5165bfd0..b4de04fe6 100644 --- a/packages_generated/cockpit/src/v1/api.gen.ts +++ b/packages_generated/cockpit/src/v1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { unmarshalAlertManager, unmarshalContactPoint, @@ -131,32 +131,34 @@ The output returned displays the URL to access your Cockpit's Grafana. { method: 'GET', path: `/cockpit/v1/grafana`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalGrafana, ) - /** * Synchronize Grafana data sources. Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it. * * @param request - The request {@link GlobalApiSyncGrafanaDataSourcesRequest} */ - syncGrafanaDataSources = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalGlobalApiSyncGrafanaDataSourcesRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/cockpit/v1/grafana/sync-data-sources`, - }, - ) + syncGrafanaDataSources = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalGlobalApiSyncGrafanaDataSourcesRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/cockpit/v1/grafana/sync-data-sources`, + }) - /** * (Deprecated) EOL 2026-01-20. Create a Grafana user Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it. @@ -170,7 +172,10 @@ Each Grafana user is associated with a role: viewer or editor. A viewer can only this.client.fetch( { body: JSON.stringify( - marshalGlobalApiCreateGrafanaUserRequest(request, this.client.settings), + marshalGlobalApiCreateGrafanaUserRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -179,8 +184,9 @@ Each Grafana user is associated with a role: viewer or editor. A viewer can only unmarshalGrafanaUser, ) - - protected pageOfListGrafanaUsers = (request: Readonly = {}) => + protected pageOfListGrafanaUsers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -188,13 +194,19 @@ Each Grafana user is associated with a role: viewer or editor. A viewer can only urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListGrafanaUsersResponse, ) - + /** * (Deprecated) EOL 2026-01-20. List Grafana users List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order. @@ -203,10 +215,10 @@ List all Grafana users created in your Cockpit's Grafana. By default, the Grafan * @param request - The request {@link GlobalApiListGrafanaUsersRequest} * @returns A Promise of ListGrafanaUsersResponse */ - listGrafanaUsers = (request: Readonly = {}) => - enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request) + listGrafanaUsers = ( + request: Readonly = {}, + ) => enrichForPagination('grafanaUsers', this.pageOfListGrafanaUsers, request) - /** * (Deprecated) EOL 2026-01-20. Delete a Grafana user Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. @@ -215,17 +227,15 @@ Delete a Grafana user from your Cockpit's Grafana, specified by the ID of the Pr * @param request - The request {@link GlobalApiDeleteGrafanaUserRequest} */ deleteGrafanaUser = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/cockpit/v1/grafana/users/${validatePathParam('grafanaUserId', request.grafanaUserId)}`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/cockpit/v1/grafana/users/${validatePathParam('grafanaUserId', request.grafanaUserId)}`, + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), + }) - /** * (Deprecated) EOL 2026-01-20. Reset a Grafana user password Reset the password of a Grafana user, specified by the ID of the Project the Cockpit belongs to, and the ID of the Grafana user. @@ -235,11 +245,16 @@ A new password regenerates and only displays once. Make sure that you save it. * @param request - The request {@link GlobalApiResetGrafanaUserPasswordRequest} * @returns A Promise of GrafanaUser */ - resetGrafanaUserPassword = (request: Readonly) => + resetGrafanaUserPassword = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalGlobalApiResetGrafanaUserPasswordRequest(request, this.client.settings), + marshalGlobalApiResetGrafanaUserPasswordRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -248,52 +263,68 @@ A new password regenerates and only displays once. Make sure that you save it. unmarshalGrafanaUser, ) - - protected pageOfListGrafanaProductDashboards = (request: Readonly = {}) => + protected pageOfListGrafanaProductDashboards = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/cockpit/v1/grafana/product-dashboards`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['tags', request.tags], ), }, unmarshalListGrafanaProductDashboardsResponse, ) - + /** * List Scaleway resources dashboards. Retrieve a list of available dashboards in Grafana, for all Scaleway resources which are integrated with Cockpit. * * @param request - The request {@link GlobalApiListGrafanaProductDashboardsRequest} * @returns A Promise of ListGrafanaProductDashboardsResponse */ - listGrafanaProductDashboards = (request: Readonly = {}) => - enrichForPagination('dashboards', this.pageOfListGrafanaProductDashboards, request) + listGrafanaProductDashboards = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'dashboards', + this.pageOfListGrafanaProductDashboards, + request, + ) - /** * Get Scaleway resource dashboard. Retrieve information about the dashboard of a Scaleway resource in Grafana, specified by the ID of the Project the Cockpit belongs to, and the name of the dashboard. * * @param request - The request {@link GlobalApiGetGrafanaProductDashboardRequest} * @returns A Promise of GrafanaProductDashboard */ - getGrafanaProductDashboard = (request: Readonly) => + getGrafanaProductDashboard = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/cockpit/v1/grafana/product-dashboards/${validatePathParam('dashboardName', request.dashboardName)}`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalGrafanaProductDashboard, ) - - protected pageOfListPlans = (request: Readonly = {}) => + protected pageOfListPlans = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -301,12 +332,15 @@ A new password regenerates and only displays once. Make sure that you save it. urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListPlansResponse, ) - + /** * List plan types. Retrieve a list of available pricing plan types. Deprecated due to retention now being managed at the data source level. @@ -318,7 +352,6 @@ Deprecated due to retention now being managed at the data source level. listPlans = (request: Readonly = {}) => enrichForPagination('plans', this.pageOfListPlans, request) - /** * Apply a pricing plan. Apply a pricing plan on a given Project. You must specify the ID of the pricing plan type. Note that you will be billed for the plan you apply. Deprecated due to retention now being managed at the data source level. @@ -340,7 +373,6 @@ Deprecated due to retention now being managed at the data source level. unmarshalPlan, ) - /** * Get current plan. Retrieve a pricing plan for the given Project, specified by the ID of the Project. Deprecated due to retention now being managed at the data source level. @@ -354,14 +386,13 @@ Deprecated due to retention now being managed at the data source level. { method: 'GET', path: `/cockpit/v1/current-plan`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalPlan, ) - - } /** @@ -374,15 +405,10 @@ export class RegionalAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Get the Cockpit configuration. * @@ -398,7 +424,6 @@ export class RegionalAPI extends ParentAPI { unmarshalGetConfigResponse, ) - /** * Create a data source. You must specify the data source name and type (metrics, logs, traces) upon creation. The name of the data source will then be used as reference to name the associated Grafana data source. @@ -410,7 +435,10 @@ The name of the data source will then be used as reference to name the associate this.client.fetch( { body: JSON.stringify( - marshalRegionalApiCreateDataSourceRequest(request, this.client.settings), + marshalRegionalApiCreateDataSourceRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -419,7 +447,6 @@ The name of the data source will then be used as reference to name the associate unmarshalDataSource, ) - /** * Get a data source. Retrieve information about a given data source, specified by the data source ID. The data source's information such as its name, type, URL, origin, and retention period, is returned. * @@ -435,22 +462,20 @@ The name of the data source will then be used as reference to name the associate unmarshalDataSource, ) - /** * Delete a data source. Delete a given data source. Note that this action will permanently delete this data source and any data associated with it. * * @param request - The request {@link RegionalApiDeleteDataSourceRequest} */ deleteDataSource = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources/${validatePathParam('dataSourceId', request.dataSourceId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/data-sources/${validatePathParam('dataSourceId', request.dataSourceId)}`, + }) - - protected pageOfListDataSources = (request: Readonly = {}) => + protected pageOfListDataSources = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -459,24 +484,30 @@ The name of the data source will then be used as reference to name the associate ['order_by', request.orderBy], ['origin', request.origin], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['types', request.types], ), }, unmarshalListDataSourcesResponse, ) - + /** * List data sources. Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order. * * @param request - The request {@link RegionalApiListDataSourcesRequest} * @returns A Promise of ListDataSourcesResponse */ - listDataSources = (request: Readonly = {}) => - enrichForPagination('dataSources', this.pageOfListDataSources, request) + listDataSources = ( + request: Readonly = {}, + ) => enrichForPagination('dataSources', this.pageOfListDataSources, request) - /** * Update a data source. Update a given data source attributes (name and/or retention_days). * @@ -487,7 +518,10 @@ The name of the data source will then be used as reference to name the associate this.client.fetch( { body: JSON.stringify( - marshalRegionalApiUpdateDataSourceRequest(request, this.client.settings), + marshalRegionalApiUpdateDataSourceRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -496,27 +530,30 @@ The name of the data source will then be used as reference to name the associate unmarshalDataSource, ) - /** * Get data source usage overview. Retrieve the volume of data ingested for each of your data sources in the specified project and region. * * @param request - The request {@link RegionalApiGetUsageOverviewRequest} * @returns A Promise of UsageOverview */ - getUsageOverview = (request: Readonly = {}) => + getUsageOverview = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/usage-overview`, urlParams: urlParams( ['interval', request.interval], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalUsageOverview, ) - /** * Create a token. Give your token the relevant scopes to ensure it has the right permissions to interact with your data sources and the Alert manager. Make sure that you create your token in the same regions as the data sources you want to use it for. Upon creation, your token's secret key display only once. Make sure that you save it. @@ -537,8 +574,9 @@ Upon creation, your token's secret key display only once. Make sure that you sav unmarshalToken, ) - - protected pageOfListTokens = (request: Readonly = {}) => + protected pageOfListTokens = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -546,14 +584,20 @@ Upon creation, your token's secret key display only once. Make sure that you sav urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['token_scopes', request.tokenScopes], ), }, unmarshalListTokensResponse, ) - + /** * List tokens. Retrieve a list of all tokens in the specified region. By default, tokens returned in the list are ordered by creation date, in ascending order. You can filter tokens by Project ID and token scopes. @@ -564,7 +608,6 @@ You can filter tokens by Project ID and token scopes. listTokens = (request: Readonly = {}) => enrichForPagination('tokens', this.pageOfListTokens, request) - /** * Get a token. Retrieve information about a given token, specified by the token ID. The token's information such as its scopes, is returned. * @@ -580,22 +623,20 @@ You can filter tokens by Project ID and token scopes. unmarshalToken, ) - /** * Delete a token. Delete a given token, specified by the token ID. Deleting a token is irreversible and cannot be undone. * * @param request - The request {@link RegionalApiDeleteTokenRequest} */ deleteToken = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`, + }) - - protected pageOfListProducts = (request: Readonly = {}) => + protected pageOfListProducts = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -603,12 +644,15 @@ You can filter tokens by Project ID and token scopes. urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListProductsResponse, ) - + /** * List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit. * @@ -618,7 +662,6 @@ You can filter tokens by Project ID and token scopes. listProducts = (request: Readonly = {}) => enrichForPagination('productsList', this.pageOfListProducts, request) - /** * Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled. The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled. @@ -626,30 +669,37 @@ The output returned displays a URL to access the Alert manager, and whether the * @param request - The request {@link RegionalApiGetAlertManagerRequest} * @returns A Promise of AlertManager */ - getAlertManager = (request: Readonly = {}) => + getAlertManager = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalAlertManager, ) - /** * Enable the Alert manager. Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention. * * @param request - The request {@link RegionalApiEnableAlertManagerRequest} * @returns A Promise of AlertManager */ - enableAlertManager = (request: Readonly = {}) => + enableAlertManager = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiEnableAlertManagerRequest(request, this.client.settings), + marshalRegionalApiEnableAlertManagerRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -658,18 +708,22 @@ The output returned displays a URL to access the Alert manager, and whether the unmarshalAlertManager, ) - /** * Disable the Alert manager. Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region. * * @param request - The request {@link RegionalApiDisableAlertManagerRequest} * @returns A Promise of AlertManager */ - disableAlertManager = (request: Readonly = {}) => + disableAlertManager = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiDisableAlertManagerRequest(request, this.client.settings), + marshalRegionalApiDisableAlertManagerRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -678,7 +732,6 @@ The output returned displays a URL to access the Alert manager, and whether the unmarshalAlertManager, ) - /** * Get the number of enabled rules. Get a detailed count of enabled rules in the specified Project. Includes preconfigured and custom alerting and recording rules. * @@ -690,14 +743,14 @@ The output returned displays a URL to access the Alert manager, and whether the { method: 'GET', path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/rules/count`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalGetRulesCountResponse, ) - /** * Create a contact point. Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to. The source of the alerts are data sources within the same Project and region as the Alert manager. @@ -706,11 +759,16 @@ If you need to receive alerts for other receivers, you can create additional con * @param request - The request {@link RegionalApiCreateContactPointRequest} * @returns A Promise of ContactPoint */ - createContactPoint = (request: Readonly = {}) => + createContactPoint = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiCreateContactPointRequest(request, this.client.settings), + marshalRegionalApiCreateContactPointRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -719,36 +777,49 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalContactPoint, ) - - protected pageOfListContactPoints = (request: Readonly = {}) => + protected pageOfListContactPoints = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListContactPointsResponse, ) - + /** * List contact points. Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API. * * @param request - The request {@link RegionalApiListContactPointsRequest} * @returns A Promise of ListContactPointsResponse */ - listContactPoints = (request: Readonly = {}) => + listContactPoints = ( + request: Readonly = {}, + ) => enrichForPagination('contactPoints', this.pageOfListContactPoints, request) - - updateContactPoint = (request: Readonly = {}) => + updateContactPoint = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiUpdateContactPointRequest(request, this.client.settings), + marshalRegionalApiUpdateContactPointRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -757,25 +828,26 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalContactPoint, ) - /** * Delete a contact point. Delete a contact point associated with the default receiver. * * @param request - The request {@link RegionalApiDeleteContactPointRequest} */ - deleteContactPoint = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalRegionalApiDeleteContactPointRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`, - }, - ) + deleteContactPoint = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalRegionalApiDeleteContactPointRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/contact-points/delete`, + }) - /** * List alerts. List preconfigured and/or custom alerts for the specified Project and data source. * @@ -790,7 +862,10 @@ If you need to receive alerts for other receivers, you can create additional con urlParams: urlParams( ['data_source_id', request.dataSourceId], ['is_preconfigured', request.isPreconfigured], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['rule_status', request.ruleStatus], ['state', request.state], ), @@ -798,7 +873,6 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalListAlertsResponse, ) - /** * Enable managed alerts. Enable the sending of managed alerts for the specified Project. Managed alerts are predefined alerts that apply to Scaleway resources integrated with Cockpit by default. * @@ -806,11 +880,16 @@ If you need to receive alerts for other receivers, you can create additional con * @param request - The request {@link RegionalApiEnableManagedAlertsRequest} * @returns A Promise of AlertManager */ - enableManagedAlerts = (request: Readonly = {}) => + enableManagedAlerts = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiEnableManagedAlertsRequest(request, this.client.settings), + marshalRegionalApiEnableManagedAlertsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -819,7 +898,6 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalAlertManager, ) - /** * Disable managed alerts. Disable the sending of managed alerts for the specified Project. * @@ -827,11 +905,16 @@ If you need to receive alerts for other receivers, you can create additional con * @param request - The request {@link RegionalApiDisableManagedAlertsRequest} * @returns A Promise of AlertManager */ - disableManagedAlerts = (request: Readonly = {}) => + disableManagedAlerts = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiDisableManagedAlertsRequest(request, this.client.settings), + marshalRegionalApiDisableManagedAlertsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -840,18 +923,22 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalAlertManager, ) - /** * Enable preconfigured alert rules. Enable alert rules from the list of available preconfigured rules. * * @param request - The request {@link RegionalApiEnableAlertRulesRequest} * @returns A Promise of EnableAlertRulesResponse */ - enableAlertRules = (request: Readonly = {}) => + enableAlertRules = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiEnableAlertRulesRequest(request, this.client.settings), + marshalRegionalApiEnableAlertRulesRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -860,18 +947,22 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalEnableAlertRulesResponse, ) - /** * Disable preconfigured alert rules. Disable alert rules from the list of available preconfigured rules. * * @param request - The request {@link RegionalApiDisableAlertRulesRequest} * @returns A Promise of DisableAlertRulesResponse */ - disableAlertRules = (request: Readonly = {}) => + disableAlertRules = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegionalApiDisableAlertRulesRequest(request, this.client.settings), + marshalRegionalApiDisableAlertRulesRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -880,24 +971,23 @@ If you need to receive alerts for other receivers, you can create additional con unmarshalDisableAlertRulesResponse, ) - /** * Trigger a test alert. Send a test alert to the Alert manager to make sure your contact points get notified. * * @param request - The request {@link RegionalApiTriggerTestAlertRequest} */ - triggerTestAlert = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalRegionalApiTriggerTestAlertRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`, - }, - ) - - + triggerTestAlert = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalRegionalApiTriggerTestAlertRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/alert-manager/trigger-test-alert`, + }) } - diff --git a/packages_generated/cockpit/src/v1/marshalling.gen.ts b/packages_generated/cockpit/src/v1/marshalling.gen.ts index 4bdc4505b..2835a865e 100644 --- a/packages_generated/cockpit/src/v1/marshalling.gen.ts +++ b/packages_generated/cockpit/src/v1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ContactPointEmail, @@ -98,7 +102,9 @@ export const unmarshalDataSource = (data: unknown): DataSource => { } as DataSource } -export const unmarshalGrafanaProductDashboard = (data: unknown): GrafanaProductDashboard => { +export const unmarshalGrafanaProductDashboard = ( + data: unknown, +): GrafanaProductDashboard => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GrafanaProductDashboard' failed as data isn't a dictionary.`, @@ -182,7 +188,9 @@ export const unmarshalAlertManager = (data: unknown): AlertManager => { } as AlertManager } -export const unmarshalDisableAlertRulesResponse = (data: unknown): DisableAlertRulesResponse => { +export const unmarshalDisableAlertRulesResponse = ( + data: unknown, +): DisableAlertRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DisableAlertRulesResponse' failed as data isn't a dictionary.`, @@ -194,7 +202,9 @@ export const unmarshalDisableAlertRulesResponse = (data: unknown): DisableAlertR } as DisableAlertRulesResponse } -export const unmarshalEnableAlertRulesResponse = (data: unknown): EnableAlertRulesResponse => { +export const unmarshalEnableAlertRulesResponse = ( + data: unknown, +): EnableAlertRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EnableAlertRulesResponse' failed as data isn't a dictionary.`, @@ -206,7 +216,9 @@ export const unmarshalEnableAlertRulesResponse = (data: unknown): EnableAlertRul } as EnableAlertRulesResponse } -const unmarshalGetConfigResponseRetention = (data: unknown): GetConfigResponseRetention => { +const unmarshalGetConfigResponseRetention = ( + data: unknown, +): GetConfigResponseRetention => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetConfigResponseRetention' failed as data isn't a dictionary.`, @@ -220,7 +232,9 @@ const unmarshalGetConfigResponseRetention = (data: unknown): GetConfigResponseRe } as GetConfigResponseRetention } -export const unmarshalGetConfigResponse = (data: unknown): GetConfigResponse => { +export const unmarshalGetConfigResponse = ( + data: unknown, +): GetConfigResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetConfigResponse' failed as data isn't a dictionary.`, @@ -228,11 +242,21 @@ export const unmarshalGetConfigResponse = (data: unknown): GetConfigResponse => } return { - customLogsRetention: data.custom_logs_retention ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) : undefined, - customMetricsRetention: data.custom_metrics_retention ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) : undefined, - customTracesRetention: data.custom_traces_retention ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) : undefined, - productLogsRetention: data.product_logs_retention ? unmarshalGetConfigResponseRetention(data.product_logs_retention) : undefined, - productMetricsRetention: data.product_metrics_retention ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) : undefined, + customLogsRetention: data.custom_logs_retention + ? unmarshalGetConfigResponseRetention(data.custom_logs_retention) + : undefined, + customMetricsRetention: data.custom_metrics_retention + ? unmarshalGetConfigResponseRetention(data.custom_metrics_retention) + : undefined, + customTracesRetention: data.custom_traces_retention + ? unmarshalGetConfigResponseRetention(data.custom_traces_retention) + : undefined, + productLogsRetention: data.product_logs_retention + ? unmarshalGetConfigResponseRetention(data.product_logs_retention) + : undefined, + productMetricsRetention: data.product_metrics_retention + ? unmarshalGetConfigResponseRetention(data.product_metrics_retention) + : undefined, } as GetConfigResponse } @@ -250,7 +274,9 @@ const unmarshalRulesCount = (data: unknown): RulesCount => { } as RulesCount } -export const unmarshalGetRulesCountResponse = (data: unknown): GetRulesCountResponse => { +export const unmarshalGetRulesCountResponse = ( + data: unknown, +): GetRulesCountResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetRulesCountResponse' failed as data isn't a dictionary.`, @@ -260,7 +286,10 @@ export const unmarshalGetRulesCountResponse = (data: unknown): GetRulesCountResp return { customRulesCount: data.custom_rules_count, preconfiguredRulesCount: data.preconfigured_rules_count, - rulesCountByDatasource: unmarshalArrayOfObject(data.rules_count_by_datasource, unmarshalRulesCount), + rulesCountByDatasource: unmarshalArrayOfObject( + data.rules_count_by_datasource, + unmarshalRulesCount, + ), } as GetRulesCountResponse } @@ -276,7 +305,9 @@ export const unmarshalGrafana = (data: unknown): Grafana => { } as Grafana } -const unmarshalPreconfiguredAlertData = (data: unknown): PreconfiguredAlertData => { +const unmarshalPreconfiguredAlertData = ( + data: unknown, +): PreconfiguredAlertData => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PreconfiguredAlertData' failed as data isn't a dictionary.`, @@ -305,7 +336,9 @@ const unmarshalAlert = (data: unknown): Alert => { duration: data.duration, name: data.name, preconfigured: data.preconfigured, - preconfiguredData: data.preconfigured_data ? unmarshalPreconfiguredAlertData(data.preconfigured_data) : undefined, + preconfiguredData: data.preconfigured_data + ? unmarshalPreconfiguredAlertData(data.preconfigured_data) + : undefined, region: data.region, rule: data.rule, ruleStatus: data.rule_status, @@ -313,7 +346,9 @@ const unmarshalAlert = (data: unknown): Alert => { } as Alert } -export const unmarshalListAlertsResponse = (data: unknown): ListAlertsResponse => { +export const unmarshalListAlertsResponse = ( + data: unknown, +): ListAlertsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAlertsResponse' failed as data isn't a dictionary.`, @@ -326,7 +361,9 @@ export const unmarshalListAlertsResponse = (data: unknown): ListAlertsResponse = } as ListAlertsResponse } -export const unmarshalListContactPointsResponse = (data: unknown): ListContactPointsResponse => { +export const unmarshalListContactPointsResponse = ( + data: unknown, +): ListContactPointsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListContactPointsResponse' failed as data isn't a dictionary.`, @@ -334,14 +371,19 @@ export const unmarshalListContactPointsResponse = (data: unknown): ListContactPo } return { - contactPoints: unmarshalArrayOfObject(data.contact_points, unmarshalContactPoint), + contactPoints: unmarshalArrayOfObject( + data.contact_points, + unmarshalContactPoint, + ), hasAdditionalContactPoints: data.has_additional_contact_points, hasAdditionalReceivers: data.has_additional_receivers, totalCount: data.total_count, } as ListContactPointsResponse } -export const unmarshalListDataSourcesResponse = (data: unknown): ListDataSourcesResponse => { +export const unmarshalListDataSourcesResponse = ( + data: unknown, +): ListDataSourcesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDataSourcesResponse' failed as data isn't a dictionary.`, @@ -354,7 +396,9 @@ export const unmarshalListDataSourcesResponse = (data: unknown): ListDataSources } as ListDataSourcesResponse } -export const unmarshalListGrafanaProductDashboardsResponse = (data: unknown): ListGrafanaProductDashboardsResponse => { +export const unmarshalListGrafanaProductDashboardsResponse = ( + data: unknown, +): ListGrafanaProductDashboardsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGrafanaProductDashboardsResponse' failed as data isn't a dictionary.`, @@ -362,12 +406,17 @@ export const unmarshalListGrafanaProductDashboardsResponse = (data: unknown): Li } return { - dashboards: unmarshalArrayOfObject(data.dashboards, unmarshalGrafanaProductDashboard), + dashboards: unmarshalArrayOfObject( + data.dashboards, + unmarshalGrafanaProductDashboard, + ), totalCount: data.total_count, } as ListGrafanaProductDashboardsResponse } -export const unmarshalListGrafanaUsersResponse = (data: unknown): ListGrafanaUsersResponse => { +export const unmarshalListGrafanaUsersResponse = ( + data: unknown, +): ListGrafanaUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGrafanaUsersResponse' failed as data isn't a dictionary.`, @@ -375,12 +424,17 @@ export const unmarshalListGrafanaUsersResponse = (data: unknown): ListGrafanaUse } return { - grafanaUsers: unmarshalArrayOfObject(data.grafana_users, unmarshalGrafanaUser), + grafanaUsers: unmarshalArrayOfObject( + data.grafana_users, + unmarshalGrafanaUser, + ), totalCount: data.total_count, } as ListGrafanaUsersResponse } -export const unmarshalListPlansResponse = (data: unknown): ListPlansResponse => { +export const unmarshalListPlansResponse = ( + data: unknown, +): ListPlansResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`, @@ -408,7 +462,9 @@ const unmarshalProduct = (data: unknown): Product => { } as Product } -export const unmarshalListProductsResponse = (data: unknown): ListProductsResponse => { +export const unmarshalListProductsResponse = ( + data: unknown, +): ListProductsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`, @@ -421,7 +477,9 @@ export const unmarshalListProductsResponse = (data: unknown): ListProductsRespon } as ListProductsResponse } -export const unmarshalListTokensResponse = (data: unknown): ListTokensResponse => { +export const unmarshalListTokensResponse = ( + data: unknown, +): ListTokensResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`, @@ -461,11 +519,21 @@ export const unmarshalUsageOverview = (data: unknown): UsageOverview => { } return { - externalLogsUsage: data.external_logs_usage ? unmarshalUsage(data.external_logs_usage) : undefined, - externalMetricsUsage: data.external_metrics_usage ? unmarshalUsage(data.external_metrics_usage) : undefined, - externalTracesUsage: data.external_traces_usage ? unmarshalUsage(data.external_traces_usage) : undefined, - scalewayLogsUsage: data.scaleway_logs_usage ? unmarshalUsage(data.scaleway_logs_usage) : undefined, - scalewayMetricsUsage: data.scaleway_metrics_usage ? unmarshalUsage(data.scaleway_metrics_usage) : undefined, + externalLogsUsage: data.external_logs_usage + ? unmarshalUsage(data.external_logs_usage) + : undefined, + externalMetricsUsage: data.external_metrics_usage + ? unmarshalUsage(data.external_metrics_usage) + : undefined, + externalTracesUsage: data.external_traces_usage + ? unmarshalUsage(data.external_traces_usage) + : undefined, + scalewayLogsUsage: data.scaleway_logs_usage + ? unmarshalUsage(data.scaleway_logs_usage) + : undefined, + scalewayMetricsUsage: data.scaleway_metrics_usage + ? unmarshalUsage(data.scaleway_metrics_usage) + : undefined, } as UsageOverview } @@ -512,11 +580,14 @@ export const marshalRegionalApiCreateContactPointRequest = ( defaults: DefaultValues, ): Record => ({ project_id: request.projectId ?? defaults.defaultProjectId, - send_resolved_notifications: request.sendResolvedNotifications, + send_resolved_notifications: request.sendResolvedNotifications, ...resolveOneOf([ - {param: 'email', - value: (request.email !== undefined) ? marshalContactPointEmail(request.email, defaults) - : undefined, + { + param: 'email', + value: + request.email !== undefined + ? marshalContactPointEmail(request.email, defaults) + : undefined, }, ]), }) @@ -537,18 +608,22 @@ export const marshalRegionalApiCreateTokenRequest = ( ): Record => ({ name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, - token_scopes: ((request.tokenScopes !== undefined) ? request.tokenScopes: undefined), + token_scopes: + request.tokenScopes !== undefined ? request.tokenScopes : undefined, }) export const marshalRegionalApiDeleteContactPointRequest = ( request: RegionalApiDeleteContactPointRequest, defaults: DefaultValues, ): Record => ({ - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf([ - {param: 'email', - value: (request.email !== undefined) ? marshalContactPointEmail(request.email, defaults) - : undefined, + { + param: 'email', + value: + request.email !== undefined + ? marshalContactPointEmail(request.email, defaults) + : undefined, }, ]), }) @@ -609,11 +684,14 @@ export const marshalRegionalApiUpdateContactPointRequest = ( defaults: DefaultValues, ): Record => ({ project_id: request.projectId ?? defaults.defaultProjectId, - send_resolved_notifications: request.sendResolvedNotifications, + send_resolved_notifications: request.sendResolvedNotifications, ...resolveOneOf([ - {param: 'email', - value: (request.email !== undefined) ? marshalContactPointEmail(request.email, defaults) - : undefined, + { + param: 'email', + value: + request.email !== undefined + ? marshalContactPointEmail(request.email, defaults) + : undefined, }, ]), }) diff --git a/packages_generated/cockpit/src/v1/types.gen.ts b/packages_generated/cockpit/src/v1/types.gen.ts index e39ee2155..2986a86e7 100644 --- a/packages_generated/cockpit/src/v1/types.gen.ts +++ b/packages_generated/cockpit/src/v1/types.gen.ts @@ -1,13 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' +import type { Region as ScwRegion } from '@scaleway/sdk-client' - -export type AlertState = - | 'unknown_state' - | 'inactive' - | 'pending' - | 'firing' +export type AlertState = 'unknown_state' | 'inactive' | 'pending' | 'firing' export type AlertStatus = | 'unknown_status' @@ -22,16 +17,9 @@ export type DataSourceOrigin = | 'external' | 'custom' -export type DataSourceType = - | 'unknown_type' - | 'metrics' - | 'logs' - | 'traces' +export type DataSourceType = 'unknown_type' | 'metrics' | 'logs' | 'traces' -export type GrafanaUserRole = - | 'unknown_role' - | 'editor' - | 'viewer' +export type GrafanaUserRole = 'unknown_role' | 'editor' | 'viewer' export type ListDataSourcesRequestOrderBy = | 'created_at_asc' @@ -41,13 +29,9 @@ export type ListDataSourcesRequestOrderBy = | 'type_asc' | 'type_desc' -export type ListGrafanaUsersRequestOrderBy = - | 'login_asc' - | 'login_desc' +export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc' -export type ListPlansRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc' export type ListProductsRequestOrderBy = | 'created_at_asc' @@ -63,11 +47,7 @@ export type ListTokensRequestOrderBy = | 'name_asc' | 'name_desc' -export type PlanName = - | 'unknown_name' - | 'free' - | 'premium' - | 'custom' +export type PlanName = 'unknown_name' | 'free' | 'premium' | 'custom' export type TokenScope = | 'unknown_scope' @@ -81,10 +61,7 @@ export type TokenScope = | 'read_only_traces' | 'write_only_traces' -export type UsageUnit = - | 'unknown_unit' - | 'bytes' - | 'samples' +export type UsageUnit = 'unknown_unit' | 'bytes' | 'samples' /** * Structure for additional data relative to preconfigured alerts. @@ -112,19 +89,16 @@ export interface PreconfiguredAlertData { productFamily: string } - export interface ContactPointEmail { to: string } - export interface GetConfigResponseRetention { minDays: number maxDays: number defaultDays: number } - export interface RulesCount { /** * ID of the data source. @@ -140,7 +114,6 @@ export interface RulesCount { rulesCount: number } - /** * Structure representing an alert. */ @@ -187,7 +160,6 @@ export interface Alert { dataSourceId: string } - /** * Contact point. */ @@ -208,7 +180,6 @@ export interface ContactPoint { sendResolvedNotifications: boolean } - /** * Data source. */ @@ -263,7 +234,6 @@ export interface DataSource { currentMonthUsage?: number } - /** * Grafana dashboard. */ @@ -290,7 +260,6 @@ export interface GrafanaProductDashboard { variables: string[] } - /** * Grafana user. */ @@ -313,7 +282,6 @@ export interface GrafanaUser { password?: string } - /** * Type of pricing plan. */ @@ -352,7 +320,6 @@ export interface Plan { monthlyPrice: number } - export interface Product { name: string displayName: string @@ -360,7 +327,6 @@ export interface Product { resourceTypes: string[] } - /** * Token. */ @@ -399,7 +365,6 @@ export interface Token { region: ScwRegion } - /** * Data source usage. */ @@ -438,7 +403,6 @@ export interface Usage { region: ScwRegion } - /** * Alert manager information. */ @@ -461,7 +425,6 @@ export interface AlertManager { region: ScwRegion } - /** * Output returned when alert rules are disabled. */ @@ -472,7 +435,6 @@ export interface DisableAlertRulesResponse { disabledRuleIds: string[] } - /** * Output returned when alert rules are enabled. */ @@ -483,7 +445,6 @@ export interface EnableAlertRulesResponse { enabledRuleIds: string[] } - /** * Cockpit configuration. */ @@ -510,7 +471,6 @@ export interface GetConfigResponse { productLogsRetention?: GetConfigResponseRetention } - export interface GetRulesCountResponse { /** * Total count of rules grouped by data source. @@ -526,7 +486,6 @@ export interface GetRulesCountResponse { customRulesCount: number } - /** * Create a Grafana user. */ @@ -545,7 +504,6 @@ export type GlobalApiCreateGrafanaUserRequest = { role?: GrafanaUserRole } - /** * Delete a Grafana user. */ @@ -560,7 +518,6 @@ export type GlobalApiDeleteGrafanaUserRequest = { projectId?: string } - /** * Retrieve a pricing plan for the given Project. */ @@ -571,7 +528,6 @@ export type GlobalApiGetCurrentPlanRequest = { projectId?: string } - /** * Retrieve a specific dashboard. */ @@ -586,7 +542,6 @@ export type GlobalApiGetGrafanaProductDashboardRequest = { projectId?: string } - /** * Request a Grafana. */ @@ -597,7 +552,6 @@ export type GlobalApiGetGrafanaRequest = { projectId?: string } - /** * Retrieve a list of available product dashboards. */ @@ -620,7 +574,6 @@ export type GlobalApiListGrafanaProductDashboardsRequest = { tags?: string[] } - /** * List all Grafana users. */ @@ -643,7 +596,6 @@ export type GlobalApiListGrafanaUsersRequest = { projectId?: string } - /** * Retrieve a list of available pricing plans. */ @@ -659,7 +611,6 @@ export type GlobalApiListPlansRequest = { orderBy?: ListPlansRequestOrderBy } - /** * Reset a Grafana user's password. */ @@ -674,7 +625,6 @@ export type GlobalApiResetGrafanaUserPasswordRequest = { projectId?: string } - /** * Select a specific pricing plan. */ @@ -689,7 +639,6 @@ export type GlobalApiSelectPlanRequest = { planName?: PlanName } - /** * Trigger the synchronization of all data sources created in the relevant regions. */ @@ -700,7 +649,6 @@ export type GlobalApiSyncGrafanaDataSourcesRequest = { projectId?: string } - /** * Grafana user. */ @@ -711,7 +659,6 @@ export interface Grafana { grafanaUrl: string } - /** * Retrieve a list of alerts matching the request. */ @@ -726,7 +673,6 @@ export interface ListAlertsResponse { alerts: Alert[] } - /** * Response returned when listing contact points. */ @@ -749,7 +695,6 @@ export interface ListContactPointsResponse { hasAdditionalContactPoints: boolean } - /** * Response returned when listing data sources. */ @@ -764,7 +709,6 @@ export interface ListDataSourcesResponse { dataSources: DataSource[] } - /** * Output returned when listing dashboards. */ @@ -779,7 +723,6 @@ export interface ListGrafanaProductDashboardsResponse { dashboards: GrafanaProductDashboard[] } - /** * Output returned when listing Grafana users. */ @@ -794,7 +737,6 @@ export interface ListGrafanaUsersResponse { grafanaUsers: GrafanaUser[] } - /** * Output returned when listing pricing plans. */ @@ -809,13 +751,11 @@ export interface ListPlansResponse { plans: Plan[] } - export interface ListProductsResponse { productsList: Product[] totalCount: number } - /** * Response returned when listing tokens. */ @@ -830,7 +770,6 @@ export interface ListTokensResponse { tokens: Token[] } - /** * Create a contact point. */ @@ -855,7 +794,6 @@ export type RegionalApiCreateContactPointRequest = { sendResolvedNotifications?: boolean } - /** * Create a data source. */ @@ -882,7 +820,6 @@ export type RegionalApiCreateDataSourceRequest = { retentionDays?: number } - /** * Create a token. */ @@ -905,7 +842,6 @@ export type RegionalApiCreateTokenRequest = { tokenScopes?: TokenScope[] } - /** * Delete a contact point. */ @@ -926,7 +862,6 @@ export type RegionalApiDeleteContactPointRequest = { email?: ContactPointEmail } - /** * Delete a data source. */ @@ -941,7 +876,6 @@ export type RegionalApiDeleteDataSourceRequest = { dataSourceId: string } - /** * Delete a token. */ @@ -956,7 +890,6 @@ export type RegionalApiDeleteTokenRequest = { tokenId: string } - /** * Disable the Alert manager. */ @@ -971,7 +904,6 @@ export type RegionalApiDisableAlertManagerRequest = { projectId?: string } - export type RegionalApiDisableAlertRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -987,7 +919,6 @@ export type RegionalApiDisableAlertRulesRequest = { ruleIds?: string[] } - /** * Disable the sending of managed alerts. */ @@ -1002,7 +933,6 @@ export type RegionalApiDisableManagedAlertsRequest = { projectId?: string } - /** * Enable the Alert manager. */ @@ -1017,7 +947,6 @@ export type RegionalApiEnableAlertManagerRequest = { projectId?: string } - export type RegionalApiEnableAlertRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1033,7 +962,6 @@ export type RegionalApiEnableAlertRulesRequest = { ruleIds?: string[] } - /** * Enable the sending of managed alerts. */ @@ -1048,7 +976,6 @@ export type RegionalApiEnableManagedAlertsRequest = { projectId?: string } - /** * Get the Alert manager. */ @@ -1063,7 +990,6 @@ export type RegionalApiGetAlertManagerRequest = { projectId?: string } - /** * Get Cockpit configuration. */ @@ -1074,7 +1000,6 @@ export type RegionalApiGetConfigRequest = { region?: ScwRegion } - /** * Retrieve a data source. */ @@ -1089,7 +1014,6 @@ export type RegionalApiGetDataSourceRequest = { dataSourceId: string } - export type RegionalApiGetRulesCountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1101,7 +1025,6 @@ export type RegionalApiGetRulesCountRequest = { projectId?: string } - /** * Get a token. */ @@ -1116,7 +1039,6 @@ export type RegionalApiGetTokenRequest = { tokenId: string } - export type RegionalApiGetUsageOverviewRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1126,7 +1048,6 @@ export type RegionalApiGetUsageOverviewRequest = { interval?: string } - /** * Retrieve a list of alerts. */ @@ -1157,7 +1078,6 @@ export type RegionalApiListAlertsRequest = { dataSourceId?: string } - /** * List contact points. */ @@ -1180,7 +1100,6 @@ export type RegionalApiListContactPointsRequest = { projectId?: string } - /** * List data sources. */ @@ -1215,7 +1134,6 @@ export type RegionalApiListDataSourcesRequest = { types?: DataSourceType[] } - /** * List all Scaleway products that send metrics and/or logs to Cockpit. */ @@ -1238,7 +1156,6 @@ export type RegionalApiListProductsRequest = { orderBy?: ListProductsRequestOrderBy } - /** * List tokens. */ @@ -1269,7 +1186,6 @@ export type RegionalApiListTokensRequest = { tokenScopes?: TokenScope[] } - /** * Request to trigger a test alert. */ @@ -1284,7 +1200,6 @@ export type RegionalApiTriggerTestAlertRequest = { projectId?: string } - /** * Update a contact point. */ @@ -1309,7 +1224,6 @@ export type RegionalApiUpdateContactPointRequest = { sendResolvedNotifications?: boolean } - /** * Update a data source name. */ @@ -1332,7 +1246,6 @@ export type RegionalApiUpdateDataSourceRequest = { retentionDays?: number } - export interface UsageOverview { scalewayMetricsUsage?: Usage scalewayLogsUsage?: Usage @@ -1340,5 +1253,3 @@ export interface UsageOverview { externalLogsUsage?: Usage externalTracesUsage?: Usage } - - diff --git a/packages_generated/container/src/v1beta1/api.gen.ts b/packages_generated/container/src/v1beta1/api.gen.ts index 1445e853a..755ab1daf 100644 --- a/packages_generated/container/src/v1beta1/api.gen.ts +++ b/packages_generated/container/src/v1beta1/api.gen.ts @@ -9,8 +9,15 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CONTAINER_TRANSIENT_STATUSES as CONTAINER_TRANSIENT_STATUSES_CONTAINER,CRON_TRANSIENT_STATUSES as CRON_TRANSIENT_STATUSES_CONTAINER,DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_CONTAINER,NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_CONTAINER,TOKEN_TRANSIENT_STATUSES as TOKEN_TRANSIENT_STATUSES_CONTAINER,TRIGGER_TRANSIENT_STATUSES as TRIGGER_TRANSIENT_STATUSES_CONTAINER,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + CONTAINER_TRANSIENT_STATUSES as CONTAINER_TRANSIENT_STATUSES_CONTAINER, + CRON_TRANSIENT_STATUSES as CRON_TRANSIENT_STATUSES_CONTAINER, + DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_CONTAINER, + NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_CONTAINER, + TOKEN_TRANSIENT_STATUSES as TOKEN_TRANSIENT_STATUSES_CONTAINER, + TRIGGER_TRANSIENT_STATUSES as TRIGGER_TRANSIENT_STATUSES_CONTAINER, +} from './content.gen.js' import { unmarshalContainer, marshalCreateContainerRequest, @@ -93,16 +100,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListNamespaces = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListNamespaces = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -112,13 +116,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListNamespacesResponse, ) - + /** * List all your namespaces. List all namespaces in a specified region. * @@ -128,7 +135,6 @@ export class API extends ParentAPI { listNamespaces = (request: Readonly = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request) - /** * Get a namespace. Get the namespace associated with the specified ID. * @@ -143,7 +149,7 @@ export class API extends ParentAPI { }, unmarshalNamespace, ) - + /** * Waits for {@link Namespace} to be in a final state. * @@ -156,13 +162,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !NAMESPACE_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getNamespace, request, options, ) - /** * Create a new namespace. Create a new namespace in a specified region. * @@ -182,7 +191,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Update an existing namespace. Update the space associated with the specified ID. * @@ -202,7 +210,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Delete an existing namespace. Delete the namespace associated with the specified ID. * @@ -218,7 +225,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - protected pageOfListContainers = (request: Readonly) => this.client.fetch( { @@ -230,13 +236,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListContainersResponse, ) - + /** * List all your containers. List all containers for a specified region. * @@ -246,7 +255,6 @@ export class API extends ParentAPI { listContainers = (request: Readonly) => enrichForPagination('containers', this.pageOfListContainers, request) - /** * Get a container. Get the container associated with the specified ID. * @@ -261,7 +269,7 @@ export class API extends ParentAPI { }, unmarshalContainer, ) - + /** * Waits for {@link Container} to be in a final state. * @@ -274,13 +282,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CONTAINER_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CONTAINER_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getContainer, request, options, ) - /** * Create a new container. Create a new container in the specified region. * @@ -300,7 +311,6 @@ export class API extends ParentAPI { unmarshalContainer, ) - /** * Update an existing container. Update the container associated with the specified ID. @@ -323,7 +333,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalContainer, ) - /** * Delete a container. Delete the container associated with the specified ID. * @@ -339,7 +348,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalContainer, ) - /** * Deploy a container. Deploy a container associated with the specified ID. * @@ -357,7 +365,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalContainer, ) - protected pageOfListCrons = (request: Readonly) => this.client.fetch( { @@ -367,12 +374,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['container_id', request.containerId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCronsResponse, ) - + /** * List all your crons. * @@ -382,7 +392,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listCrons = (request: Readonly) => enrichForPagination('crons', this.pageOfListCrons, request) - /** * Get a cron. Get the cron associated with the specified ID. * @@ -397,7 +406,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalCron, ) - + /** * Waits for {@link Cron} to be in a final state. * @@ -410,13 +419,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CRON_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getCron, request, options, ) - /** * Create a new cron. * @@ -436,7 +448,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - /** * Update an existing cron. Update the cron associated with the specified ID. * @@ -456,7 +467,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - /** * Delete an existing cron. Delete the cron associated with the specified ID. * @@ -472,7 +482,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - protected pageOfListDomains = (request: Readonly) => this.client.fetch( { @@ -482,12 +491,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['container_id', request.containerId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDomainsResponse, ) - + /** * List all custom domains. List all custom domains in a specified region. * @@ -497,7 +509,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listDomains = (request: Readonly) => enrichForPagination('domains', this.pageOfListDomains, request) - /** * Get a custom domain. Get a custom domain for the container with the specified ID. * @@ -512,7 +523,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalDomain, ) - + /** * Waits for {@link Domain} to be in a final state. * @@ -525,13 +536,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DOMAIN_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getDomain, request, options, ) - /** * Create a custom domain. Create a custom domain for the container with the specified ID. * @@ -551,7 +565,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalDomain, ) - /** * Delete a custom domain. Delete the custom domain with the specific ID. * @@ -567,7 +580,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalDomain, ) - /** * Create a new revocable token. Deprecated in favor of IAM authentication. * @@ -588,7 +600,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalToken, ) - /** * Get a token. Get a token with a specified ID. * @@ -603,7 +614,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalToken, ) - + /** * Waits for {@link Token} to be in a final state. * @@ -616,13 +627,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !TOKEN_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getToken, request, options, ) - protected pageOfListTokens = (request: Readonly = {}) => this.client.fetch( { @@ -633,12 +647,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListTokensResponse, ) - + /** * List all tokens. List all tokens belonging to a specified Organization or Project. * @@ -648,7 +665,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listTokens = (request: Readonly = {}) => enrichForPagination('tokens', this.pageOfListTokens, request) - /** * Delete a token. Delete a token with a specified ID. * @@ -664,7 +680,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalToken, ) - /** * Create a trigger. Create a new trigger for a specified container. * @@ -684,7 +699,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalTrigger, ) - /** * Get a trigger. Get a trigger with a specified ID. * @@ -699,7 +713,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalTrigger, ) - + /** * Waits for {@link Trigger} to be in a final state. * @@ -712,14 +726,19 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES_CONTAINER.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !TRIGGER_TRANSIENT_STATUSES_CONTAINER.includes(res.status), + )), this.getTrigger, request, options, ) - - protected pageOfListTriggers = (request: Readonly = {}) => + protected pageOfListTriggers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -727,23 +746,26 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ...Object.entries(resolveOneOf([ - {param: 'container_id', - value: request.containerId, - }, - {param: 'namespace_id', - value: request.namespaceId, - }, - {default: this.client.settings.defaultProjectId,param: 'project_id', - value: request.projectId, - }, - ])), + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ...Object.entries( + resolveOneOf([ + { param: 'container_id', value: request.containerId }, + { param: 'namespace_id', value: request.namespaceId }, + { + default: this.client.settings.defaultProjectId, + param: 'project_id', + value: request.projectId, + }, + ]), + ), ), }, unmarshalListTriggersResponse, ) - + /** * List all triggers. List all triggers belonging to a specified Organization or Project. * @@ -753,7 +775,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listTriggers = (request: Readonly = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request) - /** * Update a trigger. Update a trigger with a specified ID. * @@ -773,7 +794,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalTrigger, ) - /** * Delete a trigger. Delete a trigger with a specified ID. * @@ -788,7 +808,4 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalTrigger, ) - - } - diff --git a/packages_generated/container/src/v1beta1/content.gen.ts b/packages_generated/container/src/v1beta1/content.gen.ts index 63055861a..6f832c6ab 100644 --- a/packages_generated/container/src/v1beta1/content.gen.ts +++ b/packages_generated/container/src/v1beta1/content.gen.ts @@ -9,7 +9,6 @@ import type { TriggerStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link ContainerStatus}. */ export const CONTAINER_TRANSIENT_STATUSES: ContainerStatus[] = [ 'deleting', @@ -39,10 +38,7 @@ export const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[] = [ ] /** Lists transient statutes of the enum {@link TokenStatus}. */ -export const TOKEN_TRANSIENT_STATUSES: TokenStatus[] = [ - 'deleting', - 'creating', -] +export const TOKEN_TRANSIENT_STATUSES: TokenStatus[] = ['deleting', 'creating'] /** Lists transient statutes of the enum {@link TriggerStatus}. */ export const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[] = [ @@ -50,4 +46,3 @@ export const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[] = [ 'creating', 'pending', ] - diff --git a/packages_generated/container/src/v1beta1/index.gen.ts b/packages_generated/container/src/v1beta1/index.gen.ts index 69c27b7d2..ba2ab7a1b 100644 --- a/packages_generated/container/src/v1beta1/index.gen.ts +++ b/packages_generated/container/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/container/src/v1beta1/marshalling.gen.ts b/packages_generated/container/src/v1beta1/marshalling.gen.ts index e2b04616b..d84f07719 100644 --- a/packages_generated/container/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/container/src/v1beta1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ContainerHealthCheckSpecHTTPProbe, @@ -41,7 +46,9 @@ import type { UpdateTriggerRequest, } from './types.gen.js' -const unmarshalContainerHealthCheckSpecHTTPProbe = (data: unknown): ContainerHealthCheckSpecHTTPProbe => { +const unmarshalContainerHealthCheckSpecHTTPProbe = ( + data: unknown, +): ContainerHealthCheckSpecHTTPProbe => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContainerHealthCheckSpecHTTPProbe' failed as data isn't a dictionary.`, @@ -53,18 +60,21 @@ const unmarshalContainerHealthCheckSpecHTTPProbe = (data: unknown): ContainerHea } as ContainerHealthCheckSpecHTTPProbe } -const unmarshalContainerHealthCheckSpecTCPProbe = (data: unknown): ContainerHealthCheckSpecTCPProbe => { +const unmarshalContainerHealthCheckSpecTCPProbe = ( + data: unknown, +): ContainerHealthCheckSpecTCPProbe => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContainerHealthCheckSpecTCPProbe' failed as data isn't a dictionary.`, ) } - return { - } as ContainerHealthCheckSpecTCPProbe + return {} as ContainerHealthCheckSpecTCPProbe } -const unmarshalContainerHealthCheckSpec = (data: unknown): ContainerHealthCheckSpec => { +const unmarshalContainerHealthCheckSpec = ( + data: unknown, +): ContainerHealthCheckSpec => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContainerHealthCheckSpec' failed as data isn't a dictionary.`, @@ -73,13 +83,19 @@ const unmarshalContainerHealthCheckSpec = (data: unknown): ContainerHealthCheckS return { failureThreshold: data.failure_threshold, - http: data.http ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) : undefined, + http: data.http + ? unmarshalContainerHealthCheckSpecHTTPProbe(data.http) + : undefined, interval: data.interval, - tcp: data.tcp ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) : undefined, + tcp: data.tcp + ? unmarshalContainerHealthCheckSpecTCPProbe(data.tcp) + : undefined, } as ContainerHealthCheckSpec } -const unmarshalContainerScalingOption = (data: unknown): ContainerScalingOption => { +const unmarshalContainerScalingOption = ( + data: unknown, +): ContainerScalingOption => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContainerScalingOption' failed as data isn't a dictionary.`, @@ -122,7 +138,9 @@ export const unmarshalContainer = (data: unknown): Container => { domainName: data.domain_name, environmentVariables: data.environment_variables, errorMessage: data.error_message, - healthCheck: data.health_check ? unmarshalContainerHealthCheckSpec(data.health_check) : undefined, + healthCheck: data.health_check + ? unmarshalContainerHealthCheckSpec(data.health_check) + : undefined, httpOption: data.http_option, id: data.id, localStorageLimit: data.local_storage_limit, @@ -140,8 +158,13 @@ export const unmarshalContainer = (data: unknown): Container => { region: data.region, registryImage: data.registry_image, sandbox: data.sandbox, - scalingOption: data.scaling_option ? unmarshalContainerScalingOption(data.scaling_option) : undefined, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), + scalingOption: data.scaling_option + ? unmarshalContainerScalingOption(data.scaling_option) + : undefined, + secretEnvironmentVariables: unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue, + ), status: data.status, tags: data.tags, timeout: data.timeout, @@ -202,7 +225,10 @@ export const unmarshalNamespace = (data: unknown): Namespace => { region: data.region, registryEndpoint: data.registry_endpoint, registryNamespaceId: data.registry_namespace_id, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), + secretEnvironmentVariables: unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue, + ), status: data.status, tags: data.tags, updatedAt: unmarshalDate(data.updated_at), @@ -229,7 +255,9 @@ export const unmarshalToken = (data: unknown): Token => { } as Token } -const unmarshalTriggerMnqNatsClientConfig = (data: unknown): TriggerMnqNatsClientConfig => { +const unmarshalTriggerMnqNatsClientConfig = ( + data: unknown, +): TriggerMnqNatsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`, @@ -245,7 +273,9 @@ const unmarshalTriggerMnqNatsClientConfig = (data: unknown): TriggerMnqNatsClien } as TriggerMnqNatsClientConfig } -const unmarshalTriggerMnqSqsClientConfig = (data: unknown): TriggerMnqSqsClientConfig => { +const unmarshalTriggerMnqSqsClientConfig = ( + data: unknown, +): TriggerMnqSqsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`, @@ -260,7 +290,9 @@ const unmarshalTriggerMnqSqsClientConfig = (data: unknown): TriggerMnqSqsClientC } as TriggerMnqSqsClientConfig } -const unmarshalTriggerSqsClientConfig = (data: unknown): TriggerSqsClientConfig => { +const unmarshalTriggerSqsClientConfig = ( + data: unknown, +): TriggerSqsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`, @@ -289,14 +321,22 @@ export const unmarshalTrigger = (data: unknown): Trigger => { id: data.id, inputType: data.input_type, name: data.name, - scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined, - scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined, - sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined, + scwNatsConfig: data.scw_nats_config + ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) + : undefined, + scwSqsConfig: data.scw_sqs_config + ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) + : undefined, + sqsConfig: data.sqs_config + ? unmarshalTriggerSqsClientConfig(data.sqs_config) + : undefined, status: data.status, } as Trigger } -export const unmarshalListContainersResponse = (data: unknown): ListContainersResponse => { +export const unmarshalListContainersResponse = ( + data: unknown, +): ListContainersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListContainersResponse' failed as data isn't a dictionary.`, @@ -309,7 +349,9 @@ export const unmarshalListContainersResponse = (data: unknown): ListContainersRe } as ListContainersResponse } -export const unmarshalListCronsResponse = (data: unknown): ListCronsResponse => { +export const unmarshalListCronsResponse = ( + data: unknown, +): ListCronsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`, @@ -322,7 +364,9 @@ export const unmarshalListCronsResponse = (data: unknown): ListCronsResponse => } as ListCronsResponse } -export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse => { +export const unmarshalListDomainsResponse = ( + data: unknown, +): ListDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`, @@ -335,7 +379,9 @@ export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse } as ListDomainsResponse } -export const unmarshalListNamespacesResponse = (data: unknown): ListNamespacesResponse => { +export const unmarshalListNamespacesResponse = ( + data: unknown, +): ListNamespacesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`, @@ -348,7 +394,9 @@ export const unmarshalListNamespacesResponse = (data: unknown): ListNamespacesRe } as ListNamespacesResponse } -export const unmarshalListTokensResponse = (data: unknown): ListTokensResponse => { +export const unmarshalListTokensResponse = ( + data: unknown, +): ListTokensResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`, @@ -361,7 +409,9 @@ export const unmarshalListTokensResponse = (data: unknown): ListTokensResponse = } as ListTokensResponse } -export const unmarshalListTriggersResponse = (data: unknown): ListTriggersResponse => { +export const unmarshalListTriggersResponse = ( + data: unknown, +): ListTriggersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`, @@ -384,23 +434,28 @@ const marshalContainerHealthCheckSpecHTTPProbe = ( const marshalContainerHealthCheckSpecTCPProbe = ( request: ContainerHealthCheckSpecTCPProbe, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalContainerHealthCheckSpec = ( request: ContainerHealthCheckSpec, defaults: DefaultValues, ): Record => ({ failure_threshold: request.failureThreshold, - interval: request.interval, + interval: request.interval, ...resolveOneOf([ - {param: 'http', - value: (request.http !== undefined) ? marshalContainerHealthCheckSpecHTTPProbe(request.http, defaults) - : undefined, + { + param: 'http', + value: + request.http !== undefined + ? marshalContainerHealthCheckSpecHTTPProbe(request.http, defaults) + : undefined, }, - {param: 'tcp', - value: (request.tcp !== undefined) ? marshalContainerHealthCheckSpecTCPProbe(request.tcp, defaults) - : undefined, + { + param: 'tcp', + value: + request.tcp !== undefined + ? marshalContainerHealthCheckSpecTCPProbe(request.tcp, defaults) + : undefined, }, ]), }) @@ -408,17 +463,14 @@ const marshalContainerHealthCheckSpec = ( const marshalContainerScalingOption = ( request: ContainerScalingOption, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'concurrent_requests_threshold', + { + param: 'concurrent_requests_threshold', value: request.concurrentRequestsThreshold, }, - {param: 'cpu_usage_threshold', - value: request.cpuUsageThreshold, - }, - {param: 'memory_usage_threshold', - value: request.memoryUsageThreshold, - }, + { param: 'cpu_usage_threshold', value: request.cpuUsageThreshold }, + { param: 'memory_usage_threshold', value: request.memoryUsageThreshold }, ]), }) @@ -439,7 +491,10 @@ export const marshalCreateContainerRequest = ( cpu_limit: request.cpuLimit, description: request.description, environment_variables: request.environmentVariables, - health_check: ((request.healthCheck !== undefined) ? marshalContainerHealthCheckSpec(request.healthCheck, defaults): undefined), + health_check: + request.healthCheck !== undefined + ? marshalContainerHealthCheckSpec(request.healthCheck, defaults) + : undefined, http_option: request.httpOption, local_storage_limit: request.localStorageLimit, max_concurrency: request.maxConcurrency, @@ -454,8 +509,16 @@ export const marshalCreateContainerRequest = ( protocol: request.protocol, registry_image: request.registryImage, sandbox: request.sandbox, - scaling_option: ((request.scalingOption !== undefined) ? marshalContainerScalingOption(request.scalingOption, defaults): undefined), - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + scaling_option: + request.scalingOption !== undefined + ? marshalContainerScalingOption(request.scalingOption, defaults) + : undefined, + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, timeout: request.timeout, }) @@ -487,7 +550,12 @@ export const marshalCreateNamespaceRequest = ( environment_variables: request.environmentVariables, name: request.name || randomName('cns'), project_id: request.projectId ?? defaults.defaultProjectId, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, }) @@ -496,14 +564,10 @@ export const marshalCreateTokenRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - expires_at: request.expiresAt, + expires_at: request.expiresAt, ...resolveOneOf([ - {param: 'container_id', - value: request.containerId, - }, - {param: 'namespace_id', - value: request.namespaceId, - }, + { param: 'container_id', value: request.containerId }, + { param: 'namespace_id', value: request.namespaceId }, ]), }) @@ -542,19 +606,37 @@ export const marshalCreateTriggerRequest = ( ): Record => ({ container_id: request.containerId, description: request.description, - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'scw_sqs_config', - value: (request.scwSqsConfig !== undefined) ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig, defaults) - : undefined, + { + param: 'scw_sqs_config', + value: + request.scwSqsConfig !== undefined + ? marshalCreateTriggerRequestMnqSqsClientConfig( + request.scwSqsConfig, + defaults, + ) + : undefined, }, - {param: 'scw_nats_config', - value: (request.scwNatsConfig !== undefined) ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig, defaults) - : undefined, + { + param: 'scw_nats_config', + value: + request.scwNatsConfig !== undefined + ? marshalCreateTriggerRequestMnqNatsClientConfig( + request.scwNatsConfig, + defaults, + ) + : undefined, }, - {param: 'sqs_config', - value: (request.sqsConfig !== undefined) ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) - : undefined, + { + param: 'sqs_config', + value: + request.sqsConfig !== undefined + ? marshalCreateTriggerRequestSqsClientConfig( + request.sqsConfig, + defaults, + ) + : undefined, }, ]), }) @@ -568,7 +650,10 @@ export const marshalUpdateContainerRequest = ( cpu_limit: request.cpuLimit, description: request.description, environment_variables: request.environmentVariables, - health_check: ((request.healthCheck !== undefined) ? marshalContainerHealthCheckSpec(request.healthCheck, defaults): undefined), + health_check: + request.healthCheck !== undefined + ? marshalContainerHealthCheckSpec(request.healthCheck, defaults) + : undefined, http_option: request.httpOption, local_storage_limit: request.localStorageLimit, max_concurrency: request.maxConcurrency, @@ -582,8 +667,16 @@ export const marshalUpdateContainerRequest = ( redeploy: request.redeploy, registry_image: request.registryImage, sandbox: request.sandbox, - scaling_option: ((request.scalingOption !== undefined) ? marshalContainerScalingOption(request.scalingOption, defaults): undefined), - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + scaling_option: + request.scalingOption !== undefined + ? marshalContainerScalingOption(request.scalingOption, defaults) + : undefined, + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, timeout: request.timeout, }) @@ -604,7 +697,12 @@ export const marshalUpdateNamespaceRequest = ( ): Record => ({ description: request.description, environment_variables: request.environmentVariables, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, }) @@ -621,11 +719,17 @@ export const marshalUpdateTriggerRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'sqs_config', - value: (request.sqsConfig !== undefined) ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) - : undefined, + { + param: 'sqs_config', + value: + request.sqsConfig !== undefined + ? marshalUpdateTriggerRequestSqsClientConfig( + request.sqsConfig, + defaults, + ) + : undefined, }, ]), }) diff --git a/packages_generated/container/src/v1beta1/types.gen.ts b/packages_generated/container/src/v1beta1/types.gen.ts index fd73ed1a4..63f65b6a3 100644 --- a/packages_generated/container/src/v1beta1/types.gen.ts +++ b/packages_generated/container/src/v1beta1/types.gen.ts @@ -1,27 +1,17 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type ContainerHttpOption = | 'unknown_http_option' | 'enabled' | 'redirected' -export type ContainerPrivacy = - | 'unknown_privacy' - | 'public' - | 'private' +export type ContainerPrivacy = 'unknown_privacy' | 'public' | 'private' -export type ContainerProtocol = - | 'unknown_protocol' - | 'http1' - | 'h2c' +export type ContainerProtocol = 'unknown_protocol' | 'http1' | 'h2c' -export type ContainerSandbox = - | 'unknown_sandbox' - | 'v1' - | 'v2' +export type ContainerSandbox = 'unknown_sandbox' | 'v1' | 'v2' export type ContainerStatus = | 'unknown' @@ -56,9 +46,7 @@ export type ListContainersRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListCronsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListCronsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListDomainsRequestOrderBy = | 'created_at_asc' @@ -72,13 +60,9 @@ export type ListNamespacesRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListTokensRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListTriggersRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type NamespaceStatus = | 'unknown' @@ -118,10 +102,7 @@ export interface ContainerHealthCheckSpecHTTPProbe { path: string } - -export interface ContainerHealthCheckSpecTCPProbe { -} - +export interface ContainerHealthCheckSpecTCPProbe {} export interface ContainerHealthCheckSpec { /** @@ -147,7 +128,6 @@ As a result, lowering this value can help to reduce the time it takes to detect interval?: string } - export interface ContainerScalingOption { /** * @@ -166,13 +146,11 @@ export interface ContainerScalingOption { memoryUsageThreshold?: number } - export interface SecretHashedValue { key: string hashedValue: string } - export interface TriggerMnqNatsClientConfig { /** * Name of the NATS subject the trigger listens to. @@ -196,7 +174,6 @@ export interface TriggerMnqNatsClientConfig { mnqCredentialId?: string } - export interface TriggerMnqSqsClientConfig { /** * Name of the SQS queue the trigger listens to. @@ -216,7 +193,6 @@ export interface TriggerMnqSqsClientConfig { mnqCredentialId?: string } - export interface TriggerSqsClientConfig { endpoint: string queueUrl: string @@ -224,13 +200,11 @@ export interface TriggerSqsClientConfig { secretKey: string } - export interface Secret { key: string value?: string } - export interface CreateTriggerRequestMnqNatsClientConfig { /** * Name of the NATS subject the trigger should listen to. @@ -250,7 +224,6 @@ export interface CreateTriggerRequestMnqNatsClientConfig { mnqRegion: string } - export interface CreateTriggerRequestMnqSqsClientConfig { /** * Name of the SQS queue the trigger should listen to. @@ -266,7 +239,6 @@ export interface CreateTriggerRequestMnqSqsClientConfig { mnqRegion: string } - export interface CreateTriggerRequestSqsClientConfig { endpoint: string queueUrl: string @@ -274,7 +246,6 @@ export interface CreateTriggerRequestSqsClientConfig { secretKey: string } - export interface Container { /** * UUID of the container. @@ -411,7 +382,6 @@ export interface Container { args: string[] } - export interface Cron { /** * UUID of the cron. @@ -439,7 +409,6 @@ export interface Cron { name: string } - export interface Domain { /** * UUID of the domain. @@ -467,7 +436,6 @@ export interface Domain { errorMessage?: string } - export interface Namespace { /** * UUID of the namespace. @@ -535,7 +503,6 @@ export interface Namespace { vpcIntegrationActivated?: boolean } - export interface Token { /** * UUID of the token. @@ -575,7 +542,6 @@ export interface Token { expiresAt?: Date } - export interface Trigger { /** * ID of the trigger. @@ -625,13 +591,11 @@ export interface Trigger { sqsConfig?: TriggerSqsClientConfig } - export interface UpdateTriggerRequestSqsClientConfig { accessKey?: string secretKey?: string } - export type CreateContainerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -740,7 +704,6 @@ export type CreateContainerRequest = { args?: string[] } - export type CreateCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -764,7 +727,6 @@ export type CreateCronRequest = { name?: string } - export type CreateDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -780,7 +742,6 @@ export type CreateDomainRequest = { containerId: string } - export type CreateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -816,7 +777,6 @@ export type CreateNamespaceRequest = { activateVpcIntegration?: boolean } - export type CreateTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -844,7 +804,6 @@ export type CreateTokenRequest = { expiresAt?: Date } - export type CreateTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -882,7 +841,6 @@ export type CreateTriggerRequest = { sqsConfig?: CreateTriggerRequestSqsClientConfig } - export type DeleteContainerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -894,7 +852,6 @@ export type DeleteContainerRequest = { containerId: string } - export type DeleteCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -906,7 +863,6 @@ export type DeleteCronRequest = { cronId: string } - export type DeleteDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -918,7 +874,6 @@ export type DeleteDomainRequest = { domainId: string } - export type DeleteNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -930,7 +885,6 @@ export type DeleteNamespaceRequest = { namespaceId: string } - export type DeleteTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -942,7 +896,6 @@ export type DeleteTokenRequest = { tokenId: string } - export type DeleteTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -954,7 +907,6 @@ export type DeleteTriggerRequest = { triggerId: string } - export type DeployContainerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -966,7 +918,6 @@ export type DeployContainerRequest = { containerId: string } - export type GetContainerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -978,7 +929,6 @@ export type GetContainerRequest = { containerId: string } - export type GetCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -990,7 +940,6 @@ export type GetCronRequest = { cronId: string } - export type GetDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1002,7 +951,6 @@ export type GetDomainRequest = { domainId: string } - export type GetNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1014,7 +962,6 @@ export type GetNamespaceRequest = { namespaceId: string } - export type GetTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1026,7 +973,6 @@ export type GetTokenRequest = { tokenId: string } - export type GetTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1038,7 +984,6 @@ export type GetTriggerRequest = { triggerId: string } - export type ListContainersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1074,7 +1019,6 @@ export type ListContainersRequest = { projectId?: string } - export interface ListContainersResponse { /** * Array of containers. @@ -1086,7 +1030,6 @@ export interface ListContainersResponse { totalCount: number } - export type ListCronsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1110,7 +1053,6 @@ export type ListCronsRequest = { containerId: string } - export interface ListCronsResponse { /** * Array of crons. @@ -1122,7 +1064,6 @@ export interface ListCronsResponse { totalCount: number } - export type ListDomainsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1146,7 +1087,6 @@ export type ListDomainsRequest = { containerId: string } - export interface ListDomainsResponse { /** * Array of domains. @@ -1158,7 +1098,6 @@ export interface ListDomainsResponse { totalCount: number } - export type ListNamespacesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1190,7 +1129,6 @@ export type ListNamespacesRequest = { projectId?: string } - export interface ListNamespacesResponse { /** * Array of the namespaces. @@ -1202,7 +1140,6 @@ export interface ListNamespacesResponse { totalCount: number } - export type ListTokensRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1230,13 +1167,11 @@ export type ListTokensRequest = { namespaceId?: string } - export interface ListTokensResponse { tokens: Token[] totalCount: number } - export type ListTriggersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1274,7 +1209,6 @@ export type ListTriggersRequest = { projectId?: string } - export interface ListTriggersResponse { /** * Total count of existing triggers (matching any filters specified). @@ -1286,7 +1220,6 @@ export interface ListTriggersResponse { triggers: Trigger[] } - export type UpdateContainerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1406,7 +1339,6 @@ For example, the following payload will delete the `TO_DELETE` secret environmen args?: string[] } - export type UpdateCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1434,7 +1366,6 @@ export type UpdateCronRequest = { name?: string } - export type UpdateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1462,7 +1393,6 @@ export type UpdateNamespaceRequest = { tags?: string[] } - export type UpdateTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1487,5 +1417,3 @@ export type UpdateTriggerRequest = { */ sqsConfig?: UpdateTriggerRequestSqsClientConfig } - - diff --git a/packages_generated/container/src/v1beta1/validation-rules.gen.ts b/packages_generated/container/src/v1beta1/validation-rules.gen.ts index ee3959340..e501f4a70 100644 --- a/packages_generated/container/src/v1beta1/validation-rules.gen.ts +++ b/packages_generated/container/src/v1beta1/validation-rules.gen.ts @@ -15,8 +15,7 @@ export const ContainerHealthCheckSpecHTTPProbe = { }, } -export const ContainerScalingOption = { -} +export const ContainerScalingOption = {} export const CreateContainerRequest = { privateNetworkId: { diff --git a/packages_generated/datawarehouse/src/v1beta1/api.gen.ts b/packages_generated/datawarehouse/src/v1beta1/api.gen.ts index 8a4e13c4c..d3d1dc868 100644 --- a/packages_generated/datawarehouse/src/v1beta1/api.gen.ts +++ b/packages_generated/datawarehouse/src/v1beta1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DEPLOYMENT_TRANSIENT_STATUSES as DEPLOYMENT_TRANSIENT_STATUSES_DATAWAREHOUSE,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { DEPLOYMENT_TRANSIENT_STATUSES as DEPLOYMENT_TRANSIENT_STATUSES_DATAWAREHOUSE } from './content.gen.js' import { marshalCreateDatabaseRequest, marshalCreateDeploymentRequest, @@ -70,13 +70,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + protected pageOfListPresets = (request: Readonly = {}) => this.client.fetch( { @@ -84,12 +81,15 @@ export class API extends ParentAPI { path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/presets`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListPresetsResponse, ) - + /** * List available presets. * @@ -99,21 +99,25 @@ export class API extends ParentAPI { listPresets = (request: Readonly = {}) => enrichForPagination('presets', this.pageOfListPresets, request) - - protected pageOfListVersions = (request: Readonly = {}) => + protected pageOfListVersions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListVersionsResponse, ) - + /** * List available ClickHouse® versions. * @@ -123,8 +127,9 @@ export class API extends ParentAPI { listVersions = (request: Readonly = {}) => enrichForPagination('versions', this.pageOfListVersions, request) - - protected pageOfListDeployments = (request: Readonly = {}) => + protected pageOfListDeployments = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -134,14 +139,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListDeploymentsResponse, ) - + /** * List deployments. List all deployments in the specified region, for a given Scaleway Project. By default, the deployments returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you provide will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -151,7 +159,6 @@ export class API extends ParentAPI { listDeployments = (request: Readonly = {}) => enrichForPagination('deployments', this.pageOfListDeployments, request) - /** * Get a deployment. Retrieve information about a given deployment, specified by the `region` and `deployment_id` parameters. Its full details, including name, status are returned in the response object. * @@ -166,7 +173,7 @@ export class API extends ParentAPI { }, unmarshalDeployment, ) - + /** * Waits for {@link Deployment} to be in a final state. * @@ -179,13 +186,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES_DATAWAREHOUSE.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DEPLOYMENT_TRANSIENT_STATUSES_DATAWAREHOUSE.includes(res.status), + )), this.getDeployment, request, options, ) - /** * Create a deployment. Create a new deployment. * @@ -205,7 +215,6 @@ export class API extends ParentAPI { unmarshalDeployment, ) - /** * Update a deployment. Update the parameters of a deployment. * @@ -225,7 +234,6 @@ export class API extends ParentAPI { unmarshalDeployment, ) - /** * Delete a deployment. Delete a given deployment, specified by the `region` and `deployment_id` parameters. Deleting a deployment is permanent, and cannot be undone. Upon deletion, all your data will be lost. * @@ -241,20 +249,16 @@ export class API extends ParentAPI { unmarshalDeployment, ) - - getDeploymentCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + getDeploymentCertificate = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'GET', + path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - protected pageOfListUsers = (request: Readonly) => this.client.fetch( { @@ -264,12 +268,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListUsersResponse, ) - + /** * List users associated with a deployment. * @@ -279,7 +286,6 @@ export class API extends ParentAPI { listUsers = (request: Readonly) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Create a new user for a deployment. * @@ -299,7 +305,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update an existing user for a deployment. * @@ -319,37 +324,30 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Delete a user from a deployment. * * @param request - The request {@link DeleteUserRequest} */ deleteUser = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'DELETE', - path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/users/${validatePathParam('name', request.name)}`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'DELETE', + path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/users/${validatePathParam('name', request.name)}`, + }) - /** * Delete an endpoint from a deployment. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - /** * Create a new endpoint for a deployment. * @@ -369,7 +367,6 @@ export class API extends ParentAPI { unmarshalEndpoint, ) - protected pageOfListDatabases = (request: Readonly) => this.client.fetch( { @@ -379,12 +376,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDatabasesResponse, ) - + /** * List databases within a deployment. * @@ -394,7 +394,6 @@ export class API extends ParentAPI { listDatabases = (request: Readonly) => enrichForPagination('databases', this.pageOfListDatabases, request) - /** * Create a new database within a deployment. * @@ -414,20 +413,14 @@ export class API extends ParentAPI { unmarshalDatabase, ) - /** * Delete a database from a deployment. * * @param request - The request {@link DeleteDatabaseRequest} */ deleteDatabase = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/databases/${validatePathParam('name', request.name)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/datawarehouse/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/databases/${validatePathParam('name', request.name)}`, + }) } - diff --git a/packages_generated/datawarehouse/src/v1beta1/content.gen.ts b/packages_generated/datawarehouse/src/v1beta1/content.gen.ts index 55d0a47b1..d94fad878 100644 --- a/packages_generated/datawarehouse/src/v1beta1/content.gen.ts +++ b/packages_generated/datawarehouse/src/v1beta1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - DeploymentStatus, -} from './types.gen.js' - +import type { DeploymentStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link DeploymentStatus}. */ export const DEPLOYMENT_TRANSIENT_STATUSES: DeploymentStatus[] = [ @@ -14,4 +11,3 @@ export const DEPLOYMENT_TRANSIENT_STATUSES: DeploymentStatus[] = [ 'unlocking', 'deploying', ] - diff --git a/packages_generated/datawarehouse/src/v1beta1/index.gen.ts b/packages_generated/datawarehouse/src/v1beta1/index.gen.ts index 02ef3bc4f..eb4cec2aa 100644 --- a/packages_generated/datawarehouse/src/v1beta1/index.gen.ts +++ b/packages_generated/datawarehouse/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/datawarehouse/src/v1beta1/marshalling.gen.ts b/packages_generated/datawarehouse/src/v1beta1/marshalling.gen.ts index de9582d0e..87e31125e 100644 --- a/packages_generated/datawarehouse/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/datawarehouse/src/v1beta1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointPrivateNetworkDetails, @@ -27,7 +31,9 @@ import type { UpdateUserRequest, } from './types.gen.js' -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -39,15 +45,16 @@ const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateN } as EndpointPrivateNetworkDetails } -const unmarshalEndpointPublicDetails = (data: unknown): EndpointPublicDetails => { +const unmarshalEndpointPublicDetails = ( + data: unknown, +): EndpointPublicDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointPublicDetails + return {} as EndpointPublicDetails } const unmarshalEndpointService = (data: unknown): EndpointService => { @@ -73,8 +80,12 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { return { dnsRecord: data.dns_record, id: data.id, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, - public: data.public ? unmarshalEndpointPublicDetails(data.public) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, + public: data.public + ? unmarshalEndpointPublicDetails(data.public) + : undefined, services: unmarshalArrayOfObject(data.services, unmarshalEndpointService), } as Endpoint } @@ -131,7 +142,9 @@ export const unmarshalUser = (data: unknown): User => { } as User } -export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResponse => { +export const unmarshalListDatabasesResponse = ( + data: unknown, +): ListDatabasesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`, @@ -144,7 +157,9 @@ export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResp } as ListDatabasesResponse } -export const unmarshalListDeploymentsResponse = (data: unknown): ListDeploymentsResponse => { +export const unmarshalListDeploymentsResponse = ( + data: unknown, +): ListDeploymentsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`, @@ -174,7 +189,9 @@ const unmarshalPreset = (data: unknown): Preset => { } as Preset } -export const unmarshalListPresetsResponse = (data: unknown): ListPresetsResponse => { +export const unmarshalListPresetsResponse = ( + data: unknown, +): ListPresetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPresetsResponse' failed as data isn't a dictionary.`, @@ -187,7 +204,9 @@ export const unmarshalListPresetsResponse = (data: unknown): ListPresetsResponse } as ListPresetsResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -213,7 +232,9 @@ const unmarshalVersion = (data: unknown): Version => { } as Version } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, @@ -243,21 +264,29 @@ const marshalEndpointSpecPrivateNetworkDetails = ( const marshalEndpointSpecPublicDetails = ( request: EndpointSpecPublicDetails, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'public', - value: (request.public !== undefined) ? marshalEndpointSpecPublicDetails(request.public, defaults) - : undefined, + { + param: 'public', + value: + request.public !== undefined + ? marshalEndpointSpecPublicDetails(request.public, defaults) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkDetails( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -268,7 +297,10 @@ export const marshalCreateDeploymentRequest = ( ): Record => ({ cpu_max: request.cpuMax, cpu_min: request.cpuMin, - endpoints: ((request.endpoints !== undefined) ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), + endpoints: + request.endpoints !== undefined + ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, name: request.name, password: request.password, project_id: request.projectId ?? defaults.defaultProjectId, @@ -283,7 +315,10 @@ export const marshalCreateEndpointRequest = ( defaults: DefaultValues, ): Record => ({ deployment_id: request.deploymentId, - endpoint: ((request.endpoint !== undefined) ? marshalEndpointSpec(request.endpoint, defaults): undefined), + endpoint: + request.endpoint !== undefined + ? marshalEndpointSpec(request.endpoint, defaults) + : undefined, }) export const marshalCreateUserRequest = ( diff --git a/packages_generated/datawarehouse/src/v1beta1/types.gen.ts b/packages_generated/datawarehouse/src/v1beta1/types.gen.ts index f3301d228..21feb53f6 100644 --- a/packages_generated/datawarehouse/src/v1beta1/types.gen.ts +++ b/packages_generated/datawarehouse/src/v1beta1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type DeploymentStatus = | 'unknown_status' @@ -33,25 +32,19 @@ export type ListDeploymentsRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListUsersRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListUsersRequestOrderBy = 'name_asc' | 'name_desc' export interface EndpointPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointPublicDetails { -} - +export interface EndpointPublicDetails {} export interface EndpointService { protocol: EndpointServiceProtocol port: number } - export interface EndpointSpecPrivateNetworkDetails { /** * UUID of the Private Network. @@ -59,10 +52,7 @@ export interface EndpointSpecPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointSpecPublicDetails { -} - +export interface EndpointSpecPublicDetails {} export interface Endpoint { /** @@ -91,7 +81,6 @@ export interface Endpoint { public?: EndpointPublicDetails } - export interface EndpointSpec { /** * @@ -105,7 +94,6 @@ export interface EndpointSpec { privateNetwork?: EndpointSpecPrivateNetworkDetails } - export interface Database { /** * Name of the database. @@ -117,7 +105,6 @@ export interface Database { size: number } - export interface Deployment { /** * Unique identifier. @@ -181,7 +168,6 @@ export interface Deployment { region: ScwRegion } - export interface Preset { /** * Name of the preset. @@ -209,7 +195,6 @@ export interface Preset { replicaCount: number } - export interface User { /** * Name of the user. @@ -221,7 +206,6 @@ export interface User { isAdmin: boolean } - export interface Version { /** * Deployment version. @@ -233,7 +217,6 @@ export interface Version { endOfLifeAt?: Date } - export type CreateDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -249,7 +232,6 @@ export type CreateDatabaseRequest = { name: string } - export type CreateDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -297,7 +279,6 @@ export type CreateDeploymentRequest = { ramPerCpu: number } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -313,7 +294,6 @@ export type CreateEndpointRequest = { endpoint?: EndpointSpec } - export type CreateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -337,7 +317,6 @@ export type CreateUserRequest = { isAdmin: boolean } - export type DeleteDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -353,7 +332,6 @@ export type DeleteDatabaseRequest = { name: string } - export type DeleteDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -365,7 +343,6 @@ export type DeleteDeploymentRequest = { deploymentId: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -377,7 +354,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type DeleteUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -393,7 +369,6 @@ export type DeleteUserRequest = { name: string } - export type GetDeploymentCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -402,7 +377,6 @@ export type GetDeploymentCertificateRequest = { deploymentId: string } - export type GetDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -414,7 +388,6 @@ export type GetDeploymentRequest = { deploymentId: string } - export type ListDatabasesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -436,7 +409,6 @@ export type ListDatabasesRequest = { pageSize?: number } - export interface ListDatabasesResponse { /** * List of databases associated with the deployment. @@ -448,7 +420,6 @@ export interface ListDatabasesResponse { totalCount: number } - export type ListDeploymentsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -478,7 +449,6 @@ export type ListDeploymentsRequest = { pageSize?: number } - export interface ListDeploymentsResponse { /** * List of all deployments available in an Organization or Project. @@ -490,7 +460,6 @@ export interface ListDeploymentsResponse { totalCount: number } - export type ListPresetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -500,7 +469,6 @@ export type ListPresetsRequest = { pageSize?: number } - export interface ListPresetsResponse { /** * List of available presets. @@ -512,7 +480,6 @@ export interface ListPresetsResponse { totalCount: number } - export type ListUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -534,7 +501,6 @@ export type ListUsersRequest = { pageSize?: number } - export interface ListUsersResponse { /** * List of users associated with the deployment. @@ -546,7 +512,6 @@ export interface ListUsersResponse { totalCount: number } - export type ListVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -557,7 +522,6 @@ export type ListVersionsRequest = { pageSize?: number } - export interface ListVersionsResponse { /** * Available deployment version. @@ -569,7 +533,6 @@ export interface ListVersionsResponse { totalCount: number } - export type UpdateDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -601,7 +564,6 @@ export type UpdateDeploymentRequest = { replicaCount?: number } - export type UpdateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -624,5 +586,3 @@ export type UpdateUserRequest = { */ isAdmin?: boolean } - - diff --git a/packages_generated/dedibox/src/v1/api.gen.ts b/packages_generated/dedibox/src/v1/api.gen.ts index 677943aca..9526e51a3 100644 --- a/packages_generated/dedibox/src/v1/api.gen.ts +++ b/packages_generated/dedibox/src/v1/api.gen.ts @@ -8,8 +8,14 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {BMC_ACCESS_TRANSIENT_STATUSES as BMC_ACCESS_TRANSIENT_STATUSES_DEDIBOX,RPN_SAN_TRANSIENT_STATUSES as RPN_SAN_TRANSIENT_STATUSES_DEDIBOX,RPN_V2_GROUP_TRANSIENT_STATUSES as RPN_V2_GROUP_TRANSIENT_STATUSES_DEDIBOX,SERVER_INSTALL_TRANSIENT_STATUSES as SERVER_INSTALL_TRANSIENT_STATUSES_DEDIBOX,SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_DEDIBOX,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + BMC_ACCESS_TRANSIENT_STATUSES as BMC_ACCESS_TRANSIENT_STATUSES_DEDIBOX, + RPN_SAN_TRANSIENT_STATUSES as RPN_SAN_TRANSIENT_STATUSES_DEDIBOX, + RPN_V2_GROUP_TRANSIENT_STATUSES as RPN_V2_GROUP_TRANSIENT_STATUSES_DEDIBOX, + SERVER_INSTALL_TRANSIENT_STATUSES as SERVER_INSTALL_TRANSIENT_STATUSES_DEDIBOX, + SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_DEDIBOX, +} from './content.gen.js' import { marshalAttachFailoverIPToMacAddressRequest, marshalAttachFailoverIPsRequest, @@ -255,15 +261,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: ['fr-par-1', 'fr-par-2', 'nl-ams-1'], + }) + protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -272,14 +273,20 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['search', request.search], ), }, unmarshalListServersResponse, ) - + /** * List baremetal servers for project. * @@ -289,7 +296,6 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) - /** * Get a specific baremetal server. Get the server associated with the given ID. * @@ -304,7 +310,7 @@ export class API extends ParentAPI { }, unmarshalServer, ) - + /** * Waits for {@link Server} to be in a final state. * @@ -317,13 +323,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SERVER_TRANSIENT_STATUSES_DEDIBOX.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SERVER_TRANSIENT_STATUSES_DEDIBOX.includes(res.status), + )), this.getServer, request, options, ) - getServerBackup = (request: Readonly) => this.client.fetch( { @@ -333,7 +342,6 @@ export class API extends ParentAPI { unmarshalBackup, ) - updateServerBackup = (request: Readonly) => this.client.fetch( { @@ -347,30 +355,39 @@ export class API extends ParentAPI { unmarshalBackup, ) - - protected pageOfListSubscribableServerOptions = (request: Readonly) => + protected pageOfListSubscribableServerOptions = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/subscribable-server-options`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListSubscribableServerOptionsResponse, ) - + /** * List subscribable server options. List subscribable options associated to the given server ID. * * @param request - The request {@link ListSubscribableServerOptionsRequest} * @returns A Promise of ListSubscribableServerOptionsResponse */ - listSubscribableServerOptions = (request: Readonly) => - enrichForPagination('serverOptions', this.pageOfListSubscribableServerOptions, request) + listSubscribableServerOptions = ( + request: Readonly, + ) => + enrichForPagination( + 'serverOptions', + this.pageOfListSubscribableServerOptions, + request, + ) - /** * Subscribe server option. Subscribe option for the given server ID. * @@ -390,7 +407,6 @@ export class API extends ParentAPI { unmarshalService, ) - /** * Create a baremetal server. Create a new baremetal server. The order return you a service ID to follow the provisionning status you could call GetService. * @@ -410,14 +426,15 @@ export class API extends ParentAPI { unmarshalService, ) - /** * Subscribe storage server option. Subscribe storage option for the given server ID. * * @param request - The request {@link SubscribeStorageOptionsRequest} * @returns A Promise of SubscribeStorageOptionsResponse */ - subscribeStorageOptions = (request: Readonly) => + subscribeStorageOptions = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -430,7 +447,6 @@ export class API extends ParentAPI { unmarshalSubscribeStorageOptionsResponse, ) - /** * Update a baremetal server. Update the server associated with the given ID. * @@ -450,7 +466,6 @@ export class API extends ParentAPI { unmarshalServer, ) - updateServerTags = (request: Readonly) => this.client.fetch( { @@ -464,70 +479,59 @@ export class API extends ParentAPI { unmarshalServer, ) - /** * Reboot a baremetal server. Reboot the server associated with the given ID, use boot param to reboot in rescue. * * @param request - The request {@link RebootServerRequest} */ rebootServer = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/reboot`, + }) - /** * Start a baremetal server. Start the server associated with the given ID. * * @param request - The request {@link StartServerRequest} */ startServer = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/start`, + }) - /** * Stop a baremetal server. Stop the server associated with the given ID. * * @param request - The request {@link StopServerRequest} */ stopServer = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/stop`, + }) - /** * Delete a baremetal server. Delete the server associated with the given ID. * * @param request - The request {@link DeleteServerRequest} */ deleteServer = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, + }) - - protected pageOfListServerEvents = (request: Readonly) => + protected pageOfListServerEvents = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -535,12 +539,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListServerEventsResponse, ) - + /** * List server events. List events associated to the given server ID. * @@ -550,8 +557,9 @@ export class API extends ParentAPI { listServerEvents = (request: Readonly) => enrichForPagination('events', this.pageOfListServerEvents, request) - - protected pageOfListServerDisks = (request: Readonly) => + protected pageOfListServerDisks = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -559,12 +567,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListServerDisksResponse, ) - + /** * List server disks. List disks associated to the given server ID. * @@ -574,7 +585,6 @@ export class API extends ParentAPI { listServerDisks = (request: Readonly) => enrichForPagination('disks', this.pageOfListServerDisks, request) - getOrderedService = (request: Readonly) => this.client.fetch( { @@ -584,7 +594,6 @@ export class API extends ParentAPI { unmarshalService, ) - /** * Get a specific service. Get the service associated with the given ID. * @@ -602,7 +611,6 @@ export class API extends ParentAPI { unmarshalService, ) - /** * Delete a specific service. Delete the service associated with the given ID. * @@ -618,8 +626,9 @@ export class API extends ParentAPI { unmarshalService, ) - - protected pageOfListServices = (request: Readonly = {}) => + protected pageOfListServices = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -627,13 +636,16 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListServicesResponse, ) - + /** * List services. * @@ -643,7 +655,6 @@ export class API extends ParentAPI { listServices = (request: Readonly = {}) => enrichForPagination('services', this.pageOfListServices, request) - /** * Install a baremetal server. Install an OS on the server associated with the given ID. * @@ -663,7 +674,6 @@ export class API extends ParentAPI { unmarshalServerInstall, ) - /** * Get a specific server installation status. Get the server installation status associated with the given server ID. * @@ -678,7 +688,7 @@ export class API extends ParentAPI { }, unmarshalServerInstall, ) - + /** * Waits for {@link ServerInstall} to be in a final state. * @@ -691,34 +701,36 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SERVER_INSTALL_TRANSIENT_STATUSES_DEDIBOX.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SERVER_INSTALL_TRANSIENT_STATUSES_DEDIBOX.includes(res.status), + )), this.getServerInstall, request, options, ) - /** * Cancels the current (running) server installation. Cancels the current server installation associated with the given server ID. * * @param request - The request {@link CancelServerInstallRequest} */ cancelServerInstall = (request: Readonly) => - this.client.fetch( - { - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/cancel-install`, - }, - ) + this.client.fetch({ + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/cancel-install`, + }) - /** * Get server default partitioning. Get the server default partitioning schema associated with the given server ID and OS ID. * * @param request - The request {@link GetServerDefaultPartitioningRequest} * @returns A Promise of ServerDefaultPartitioning */ - getServerDefaultPartitioning = (request: Readonly) => + getServerDefaultPartitioning = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -727,7 +739,6 @@ export class API extends ParentAPI { unmarshalServerDefaultPartitioning, ) - /** * Start BMC (Baseboard Management Controller) access for a given baremetal server. Start BMC (Baseboard Management Controller) access associated with the given ID. The BMC (Baseboard Management Controller) access is available one hour after the installation of the server. @@ -735,18 +746,15 @@ The BMC (Baseboard Management Controller) access is available one hour after the * @param request - The request {@link StartBMCAccessRequest} */ startBMCAccess = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalStartBMCAccessRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalStartBMCAccessRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, + }) - /** * Get BMC (Baseboard Management Controller) access for a given baremetal server. Get the BMC (Baseboard Management Controller) access associated with the given ID. * @@ -761,7 +769,7 @@ The BMC (Baseboard Management Controller) access is available one hour after the }, unmarshalBMCAccess, ) - + /** * Waits for {@link BMCAccess} to be in a final state. * @@ -774,27 +782,27 @@ The BMC (Baseboard Management Controller) access is available one hour after the options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!BMC_ACCESS_TRANSIENT_STATUSES_DEDIBOX.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !BMC_ACCESS_TRANSIENT_STATUSES_DEDIBOX.includes(res.status), + )), this.getBMCAccess, request, options, ) - /** * Stop BMC (Baseboard Management Controller) access for a given baremetal server. Stop BMC (Baseboard Management Controller) access associated with the given ID. * * @param request - The request {@link StopBMCAccessRequest} */ stopBMCAccess = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/bmc-access`, + }) - protected pageOfListOffers = (request: Readonly = {}) => this.client.fetch( { @@ -809,15 +817,22 @@ The BMC (Baseboard Management Controller) access is available one hour after the ['is_rpn_san', request.isRpnSan], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], - ['sold_in', request.soldIn - && request.soldIn.length > 0 ? request.soldIn.join(',') : undefined], + [ + 'sold_in', + request.soldIn && request.soldIn.length > 0 + ? request.soldIn.join(',') + : undefined, + ], ), }, unmarshalListOffersResponse, ) - + /** * List offers. List all available server offers. * @@ -827,7 +842,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the listOffers = (request: Readonly = {}) => enrichForPagination('offers', this.pageOfListOffers, request) - /** * Get offer. Return specific offer for the given ID. * @@ -839,14 +853,11 @@ The BMC (Baseboard Management Controller) access is available one hour after the { method: 'GET', path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/offers/${validatePathParam('offerId', request.offerId)}`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalOffer, ) - protected pageOfListOS = (request: Readonly) => this.client.fetch( { @@ -855,7 +866,10 @@ The BMC (Baseboard Management Controller) access is available one hour after the urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['server_id', request.serverId], ['type', request.type], @@ -863,7 +877,7 @@ The BMC (Baseboard Management Controller) access is available one hour after the }, unmarshalListOSResponse, ) - + /** * List all available OS that can be install on a baremetal server. * @@ -873,7 +887,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the listOS = (request: Readonly) => enrichForPagination('os', this.pageOfListOS, request) - /** * Get an OS with a given ID. Return specific OS for the given ID. * @@ -893,7 +906,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalOS, ) - /** * Update reverse of ip. Update reverse of ip associated with the given ID. * @@ -913,7 +925,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalIP, ) - /** * Order failover IPs. Order X failover IPs. * @@ -933,54 +944,52 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalCreateFailoverIPsResponse, ) - /** * Attach failovers on baremetal server. Attach failovers on the server associated with the given ID. * * @param request - The request {@link AttachFailoverIPsRequest} */ attachFailoverIPs = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalAttachFailoverIPsRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalAttachFailoverIPsRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/attach`, + }) - /** * Detach failovers on baremetal server. Detach failovers on the server associated with the given ID. * * @param request - The request {@link DetachFailoverIPsRequest} */ detachFailoverIPs = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalDetachFailoverIPsRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalDetachFailoverIPsRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/detach`, + }) - /** * Attach a failover IP to a MAC address. * * @param request - The request {@link AttachFailoverIPToMacAddressRequest} * @returns A Promise of IP */ - attachFailoverIPToMacAddress = (request: Readonly) => + attachFailoverIPToMacAddress = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalAttachFailoverIPToMacAddressRequest(request, this.client.settings), + marshalAttachFailoverIPToMacAddressRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -989,14 +998,15 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalIP, ) - /** * Detach a failover IP from a MAC address. * * @param request - The request {@link DetachFailoverIPFromMacAddressRequest} * @returns A Promise of IP */ - detachFailoverIPFromMacAddress = (request: Readonly) => + detachFailoverIPFromMacAddress = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1007,22 +1017,20 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalIP, ) - /** * Delete a failover server. Delete the failover associated with the given ID. * * @param request - The request {@link DeleteFailoverIPRequest} */ deleteFailoverIP = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/failover-ips/${validatePathParam('ipId', request.ipId)}`, + }) - - protected pageOfListFailoverIPs = (request: Readonly = {}) => + protected pageOfListFailoverIPs = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1031,14 +1039,20 @@ The BMC (Baseboard Management Controller) access is available one hour after the ['only_available', request.onlyAvailable], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['search', request.search], ), }, unmarshalListFailoverIPsResponse, ) - + /** * List failovers for project. List failovers servers for project. * @@ -1048,7 +1062,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the listFailoverIPs = (request: Readonly = {}) => enrichForPagination('failoverIps', this.pageOfListFailoverIPs, request) - /** * Get a specific baremetal server. Get the server associated with the given ID. * @@ -1064,7 +1077,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalFailoverIP, ) - /** * Get remaining quota. * @@ -1076,14 +1088,11 @@ The BMC (Baseboard Management Controller) access is available one hour after the { method: 'GET', path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/remaining-quota`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalGetRemainingQuotaResponse, ) - /** * Get raid. Return raid for the given server ID. * @@ -1099,25 +1108,21 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalRaid, ) - /** * Update RAID. Update RAID associated with the given server ID. * * @param request - The request {@link UpdateRaidRequest} */ updateRaid = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalUpdateRaidRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/update-raid`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalUpdateRaidRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/update-raid`, + }) - /** * Start in rescue baremetal server. Start in rescue the server associated with the given ID. * @@ -1137,7 +1142,6 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalRescue, ) - /** * Get rescue information. Return rescue information for the given server ID. * @@ -1153,28 +1157,25 @@ The BMC (Baseboard Management Controller) access is available one hour after the unmarshalRescue, ) - /** * Stop rescue on baremetal server. Stop rescue on the server associated with the given ID. * * @param request - The request {@link StopRescueRequest} */ stopRescue = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/rescue`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/rescue`, + }) } /** * Dedibox Phoenix Billing API. */ export class BillingAPI extends ParentAPI { - protected pageOfListInvoices = (request: Readonly = {}) => + protected pageOfListInvoices = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1182,17 +1183,19 @@ export class BillingAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListInvoicesResponse, ) - + listInvoices = (request: Readonly = {}) => enrichForPagination('invoices', this.pageOfListInvoices, request) - getInvoice = (request: Readonly) => this.client.fetch( { @@ -1202,21 +1205,17 @@ export class BillingAPI extends ParentAPI { unmarshalInvoice, ) - downloadInvoice = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/dedibox/v1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/dedibox/v1/invoices/${validatePathParam('invoiceId', request.invoiceId)}/download`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - - protected pageOfListRefunds = (request: Readonly = {}) => + protected pageOfListRefunds = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1224,17 +1223,19 @@ export class BillingAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRefundsResponse, ) - + listRefunds = (request: Readonly = {}) => enrichForPagination('refunds', this.pageOfListRefunds, request) - getRefund = (request: Readonly) => this.client.fetch( { @@ -1244,33 +1245,26 @@ export class BillingAPI extends ParentAPI { unmarshalRefund, ) - downloadRefund = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/dedibox/v1/refunds/${validatePathParam('refundId', request.refundId)}/download`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/dedibox/v1/refunds/${validatePathParam('refundId', request.refundId)}/download`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - canOrder = (request: Readonly = {}) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/can-order`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalCanOrderResponse, ) - - } /** @@ -1286,30 +1280,34 @@ export class IPv6BlockAPI extends ParentAPI { * @param request - The request {@link IPv6BlockApiGetIPv6BlockQuotasRequest} * @returns A Promise of GetIPv6BlockQuotasResponse */ - getIPv6BlockQuotas = (request: Readonly = {}) => + getIPv6BlockQuotas = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/ipv6-block-quotas`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalGetIPv6BlockQuotasResponse, ) - /** * Create IPv6 block for baremetal server. Create IPv6 block associated with the given project ID. * * @param request - The request {@link IPv6BlockApiCreateIPv6BlockRequest} * @returns A Promise of IPv6Block */ - createIPv6Block = (request: Readonly = {}) => + createIPv6Block = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalIPv6BlockApiCreateIPv6BlockRequest(request, this.client.settings), + marshalIPv6BlockApiCreateIPv6BlockRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1318,26 +1316,24 @@ export class IPv6BlockAPI extends ParentAPI { unmarshalIPv6Block, ) - /** * List IPv6 blocks. List IPv6 blocks associated given project ID. * * @param request - The request {@link IPv6BlockApiListIPv6BlocksRequest} * @returns A Promise of ListIPv6BlocksResponse */ - listIPv6Blocks = (request: Readonly = {}) => + listIPv6Blocks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/ipv6-blocks`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalListIPv6BlocksResponse, ) - /** * Get first IPv6 block. Get the first IPv6 block associated with the given project ID. * @@ -1349,14 +1345,11 @@ export class IPv6BlockAPI extends ParentAPI { { method: 'GET', path: `/dedibox/v1/ipv6-block`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalIPv6Block, ) - /** * Update IPv6 block. Update DNS associated to IPv6 block. If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). @@ -1368,7 +1361,10 @@ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). this.client.fetch( { body: JSON.stringify( - marshalIPv6BlockApiUpdateIPv6BlockRequest(request, this.client.settings), + marshalIPv6BlockApiUpdateIPv6BlockRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1377,21 +1373,17 @@ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). unmarshalIPv6Block, ) - /** * Delete IPv6 block. Delete IPv6 block subnet with the given ID. * * @param request - The request {@link IPv6BlockApiDeleteIPv6BlockRequest} */ deleteIPv6Block = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/ipv6-blocks/${validatePathParam('blockId', request.blockId)}`, + }) - /** * Create IPv6 block subnet. Create IPv6 block subnet for the given IP ID. /48 could create subnet in /56 (quota link to your number of server). @@ -1400,11 +1392,16 @@ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). * @param request - The request {@link IPv6BlockApiCreateIPv6BlockSubnetRequest} * @returns A Promise of IPv6Block */ - createIPv6BlockSubnet = (request: Readonly) => + createIPv6BlockSubnet = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalIPv6BlockApiCreateIPv6BlockSubnetRequest(request, this.client.settings), + marshalIPv6BlockApiCreateIPv6BlockSubnetRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1413,14 +1410,15 @@ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). unmarshalIPv6Block, ) - /** * List available IPv6 block subnets. List all available IPv6 block subnets for given IP ID. * * @param request - The request {@link IPv6BlockApiListIPv6BlockSubnetsAvailableRequest} * @returns A Promise of ListIPv6BlockSubnetsAvailableResponse */ - listIPv6BlockSubnetsAvailable = (request: Readonly) => + listIPv6BlockSubnetsAvailable = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1428,15 +1426,15 @@ If DNS is used, minimum of 2 is necessary and maximum of 5 (no duplicate). }, unmarshalListIPv6BlockSubnetsAvailableResponse, ) - - } /** * Dedibox Phoenix RPN API. */ export class RpnAPI extends ParentAPI { - protected pageOfListRpnServerCapabilities = (request: Readonly = {}) => + protected pageOfListRpnServerCapabilities = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1444,17 +1442,25 @@ export class RpnAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnServerCapabilitiesResponse, ) - - listRpnServerCapabilities = (request: Readonly = {}) => - enrichForPagination('servers', this.pageOfListRpnServerCapabilities, request) - + listRpnServerCapabilities = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'servers', + this.pageOfListRpnServerCapabilities, + request, + ) + getRpnStatus = (request: Readonly = {}) => this.client.fetch( { @@ -1468,15 +1474,15 @@ export class RpnAPI extends ParentAPI { }, unmarshalGetRpnStatusResponse, ) - - } /** * Dedibox Phoenix RPN SAN API. */ export class RpnSanAPI extends ParentAPI { - protected pageOfListRpnSans = (request: Readonly = {}) => + protected pageOfListRpnSans = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1484,17 +1490,19 @@ export class RpnSanAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnSansResponse, ) - + listRpnSans = (request: Readonly = {}) => enrichForPagination('rpnSans', this.pageOfListRpnSans, request) - getRpnSan = (request: Readonly) => this.client.fetch( { @@ -1503,7 +1511,7 @@ export class RpnSanAPI extends ParentAPI { }, unmarshalRpnSan, ) - + /** * Waits for {@link RpnSan} to be in a final state. * @@ -1516,22 +1524,22 @@ export class RpnSanAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!RPN_SAN_TRANSIENT_STATUSES_DEDIBOX.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !RPN_SAN_TRANSIENT_STATUSES_DEDIBOX.includes(res.status), + )), this.getRpnSan, request, options, ) - deleteRpnSan = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}`, + }) - createRpnSan = (request: Readonly) => this.client.fetch( { @@ -1545,66 +1553,54 @@ export class RpnSanAPI extends ParentAPI { unmarshalService, ) - listIps = (request: Readonly) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`, - urlParams: urlParams( - ['type', request.type], - ), + urlParams: urlParams(['type', request.type]), }, unmarshalListIpsResponse, ) - addIp = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnSanApiAddIpRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnSanApiAddIpRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`, + }) - removeIp = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnSanApiRemoveIpRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'DELETE', - path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnSanApiRemoveIpRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'DELETE', + path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/ips`, + }) - listAvailableIps = (request: Readonly) => this.client.fetch( { method: 'GET', path: `/dedibox/v1/rpn-sans/${validatePathParam('rpnSanId', request.rpnSanId)}/available-ips`, - urlParams: urlParams( - ['type', request.type], - ), + urlParams: urlParams(['type', request.type]), }, unmarshalListIpsResponse, ) - - } /** * Dedibox Phoenix RPN v1 API. */ export class RpnV1API extends ParentAPI { - protected pageOfListRpnGroups = (request: Readonly = {}) => + protected pageOfListRpnGroups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1612,17 +1608,19 @@ export class RpnV1API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnGroupsResponse, ) - + listRpnGroups = (request: Readonly = {}) => enrichForPagination('rpnGroups', this.pageOfListRpnGroups, request) - getRpnGroup = (request: Readonly) => this.client.fetch( { @@ -1632,7 +1630,6 @@ export class RpnV1API extends ParentAPI { unmarshalRpnGroup, ) - createRpnGroup = (request: Readonly) => this.client.fetch( { @@ -1646,21 +1643,20 @@ export class RpnV1API extends ParentAPI { unmarshalRpnGroup, ) - deleteRpnGroup = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}`, + }) - updateRpnGroupName = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalRpnV1ApiUpdateRpnGroupNameRequest(request, this.client.settings), + marshalRpnV1ApiUpdateRpnGroupNameRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1669,8 +1665,9 @@ export class RpnV1API extends ParentAPI { unmarshalRpnGroup, ) - - protected pageOfListRpnGroupMembers = (request: Readonly) => + protected pageOfListRpnGroupMembers = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1678,48 +1675,48 @@ export class RpnV1API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnGroupMembersResponse, ) - - listRpnGroupMembers = (request: Readonly) => - enrichForPagination('members', this.pageOfListRpnGroupMembers, request) - + listRpnGroupMembers = ( + request: Readonly, + ) => enrichForPagination('members', this.pageOfListRpnGroupMembers, request) + rpnGroupInvite = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/invite`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnV1ApiRpnGroupInviteRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/invite`, + }) - leaveRpnGroup = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/leave`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnV1ApiLeaveRpnGroupRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpnv1/groups/${validatePathParam('groupId', request.groupId)}/leave`, + }) - addRpnGroupMembers = (request: Readonly) => this.client.fetch( { body: JSON.stringify( - marshalRpnV1ApiAddRpnGroupMembersRequest(request, this.client.settings), + marshalRpnV1ApiAddRpnGroupMembersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1728,12 +1725,16 @@ export class RpnV1API extends ParentAPI { unmarshalRpnGroup, ) - - deleteRpnGroupMembers = (request: Readonly) => + deleteRpnGroupMembers = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRpnV1ApiDeleteRpnGroupMembersRequest(request, this.client.settings), + marshalRpnV1ApiDeleteRpnGroupMembersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'DELETE', @@ -1742,8 +1743,9 @@ export class RpnV1API extends ParentAPI { unmarshalRpnGroup, ) - - protected pageOfListRpnCapableServers = (request: Readonly = {}) => + protected pageOfListRpnCapableServers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1751,18 +1753,23 @@ export class RpnV1API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnCapableServersResponse, ) - - listRpnCapableServers = (request: Readonly = {}) => - enrichForPagination('servers', this.pageOfListRpnCapableServers, request) - - protected pageOfListRpnCapableSanServers = (request: Readonly = {}) => + listRpnCapableServers = ( + request: Readonly = {}, + ) => enrichForPagination('servers', this.pageOfListRpnCapableServers, request) + + protected pageOfListRpnCapableSanServers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1770,18 +1777,28 @@ export class RpnV1API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnCapableSanServersResponse, ) - - listRpnCapableSanServers = (request: Readonly = {}) => - enrichForPagination('sanServers', this.pageOfListRpnCapableSanServers, request) - - protected pageOfListRpnInvites = (request: Readonly = {}) => + listRpnCapableSanServers = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'sanServers', + this.pageOfListRpnCapableSanServers, + request, + ) + + protected pageOfListRpnInvites = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1789,42 +1806,42 @@ export class RpnV1API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListRpnInvitesResponse, ) - + listRpnInvites = (request: Readonly = {}) => enrichForPagination('members', this.pageOfListRpnInvites, request) - acceptRpnInvite = (request: Readonly) => - this.client.fetch( - { - method: 'POST', - path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/accept`, - }, - ) + this.client.fetch({ + method: 'POST', + path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/accept`, + }) - refuseRpnInvite = (request: Readonly) => - this.client.fetch( - { - method: 'POST', - path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/refuse`, - }, - ) - - + this.client.fetch({ + method: 'POST', + path: `/dedibox/v1/rpnv1/invites/${validatePathParam('memberId', request.memberId)}/refuse`, + }) } /** * Dedibox Phoenix RPN v2 API. */ export class RpnV2API extends ParentAPI { - protected pageOfListRpnV2Groups = (request: Readonly = {}) => + protected pageOfListRpnV2Groups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1832,18 +1849,22 @@ export class RpnV2API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnV2GroupsResponse, ) - + listRpnV2Groups = (request: Readonly = {}) => enrichForPagination('rpnGroups', this.pageOfListRpnV2Groups, request) - - protected pageOfListRpnV2Members = (request: Readonly) => + protected pageOfListRpnV2Members = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1851,17 +1872,19 @@ export class RpnV2API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['type', request.type], ), }, unmarshalListRpnV2MembersResponse, ) - + listRpnV2Members = (request: Readonly) => enrichForPagination('members', this.pageOfListRpnV2Members, request) - getRpnV2Group = (request: Readonly) => this.client.fetch( { @@ -1870,7 +1893,7 @@ export class RpnV2API extends ParentAPI { }, unmarshalRpnV2Group, ) - + /** * Waits for {@link RpnV2Group} to be in a final state. * @@ -1883,13 +1906,16 @@ export class RpnV2API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!RPN_V2_GROUP_TRANSIENT_STATUSES_DEDIBOX.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !RPN_V2_GROUP_TRANSIENT_STATUSES_DEDIBOX.includes(res.status), + )), this.getRpnV2Group, request, options, ) - createRpnV2Group = (request: Readonly) => this.client.fetch( { @@ -1903,21 +1929,22 @@ export class RpnV2API extends ParentAPI { unmarshalRpnV2Group, ) - deleteRpnV2Group = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}`, + }) - - updateRpnV2GroupName = (request: Readonly) => + updateRpnV2GroupName = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRpnV2ApiUpdateRpnV2GroupNameRequest(request, this.client.settings), + marshalRpnV2ApiUpdateRpnV2GroupNameRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1926,34 +1953,29 @@ export class RpnV2API extends ParentAPI { unmarshalRpnV2Group, ) - addRpnV2Members = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnV2ApiAddRpnV2MembersRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`, + }) - deleteRpnV2Members = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'DELETE', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalRpnV2ApiDeleteRpnV2MembersRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'DELETE', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/members`, + }) - - protected pageOfListRpnV2CapableResources = (request: Readonly = {}) => + protected pageOfListRpnV2CapableResources = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1961,18 +1983,28 @@ export class RpnV2API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRpnV2CapableResourcesResponse, ) - - listRpnV2CapableResources = (request: Readonly = {}) => - enrichForPagination('servers', this.pageOfListRpnV2CapableResources, request) - - protected pageOfListRpnV2GroupLogs = (request: Readonly) => + listRpnV2CapableResources = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'servers', + this.pageOfListRpnV2CapableResources, + request, + ) + + protected pageOfListRpnV2GroupLogs = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1980,52 +2012,55 @@ export class RpnV2API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListRpnV2GroupLogsResponse, ) - + listRpnV2GroupLogs = (request: Readonly) => enrichForPagination('logs', this.pageOfListRpnV2GroupLogs, request) - - updateRpnV2VlanForMembers = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'PATCH', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/vlan`, - }, - ) - - - enableRpnV2GroupCompatibility = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/enable-compatibility`, - }, - ) + updateRpnV2VlanForMembers = ( + request: Readonly, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalRpnV2ApiUpdateRpnV2VlanForMembersRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'PATCH', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/vlan`, + }) - - disableRpnV2GroupCompatibility = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/disable-compatibility`, - }, - ) + enableRpnV2GroupCompatibility = ( + request: Readonly, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalRpnV2ApiEnableRpnV2GroupCompatibilityRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/enable-compatibility`, + }) - + disableRpnV2GroupCompatibility = ( + request: Readonly, + ) => + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/dedibox/v1/rpnv2/groups/${validatePathParam('groupId', request.groupId)}/disable-compatibility`, + }) } - diff --git a/packages_generated/dedibox/src/v1/content.gen.ts b/packages_generated/dedibox/src/v1/content.gen.ts index c394f6d13..627afc52c 100644 --- a/packages_generated/dedibox/src/v1/content.gen.ts +++ b/packages_generated/dedibox/src/v1/content.gen.ts @@ -12,7 +12,6 @@ import type { ServiceProvisioningStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link BMCAccessStatus}. */ export const BMC_ACCESS_TRANSIENT_STATUSES: BMCAccessStatus[] = [ 'creating', @@ -20,9 +19,8 @@ export const BMC_ACCESS_TRANSIENT_STATUSES: BMCAccessStatus[] = [ ] /** Lists transient statutes of the enum {@link IPv6BlockDelegationStatus}. */ -export const I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES: IPv6BlockDelegationStatus[] = [ - 'updating', -] +export const I_PV6_BLOCK_DELEGATION_TRANSIENT_STATUSES: IPv6BlockDelegationStatus[] = + ['updating'] /** Lists transient statutes of the enum {@link RpnGroupMemberStatus}. */ export const RPN_GROUP_MEMBER_TRANSIENT_STATUSES: RpnGroupMemberStatus[] = [ @@ -69,8 +67,5 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [ ] /** Lists transient statutes of the enum {@link ServiceProvisioningStatus}. */ -export const SERVICE_PROVISIONING_TRANSIENT_STATUSES: ServiceProvisioningStatus[] = [ - 'delivering', - 'expiring', -] - +export const SERVICE_PROVISIONING_TRANSIENT_STATUSES: ServiceProvisioningStatus[] = + ['delivering', 'expiring'] diff --git a/packages_generated/dedibox/src/v1/marshalling.gen.ts b/packages_generated/dedibox/src/v1/marshalling.gen.ts index f5ec1e9e2..a91c2cedf 100644 --- a/packages_generated/dedibox/src/v1/marshalling.gen.ts +++ b/packages_generated/dedibox/src/v1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { IP, @@ -253,7 +257,9 @@ const unmarshalOfferBandwidthInfo = (data: unknown): OfferBandwidthInfo => { } as OfferBandwidthInfo } -const unmarshalOfferFailoverBlockInfo = (data: unknown): OfferFailoverBlockInfo => { +const unmarshalOfferFailoverBlockInfo = ( + data: unknown, +): OfferFailoverBlockInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OfferFailoverBlockInfo' failed as data isn't a dictionary.`, @@ -261,7 +267,9 @@ const unmarshalOfferFailoverBlockInfo = (data: unknown): OfferFailoverBlockInfo } return { - onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : undefined, + onetimeFees: data.onetime_fees + ? unmarshalOffer(data.onetime_fees) + : undefined, } as OfferFailoverBlockInfo } @@ -273,7 +281,9 @@ const unmarshalOfferFailoverIpInfo = (data: unknown): OfferFailoverIpInfo => { } return { - onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : undefined, + onetimeFees: data.onetime_fees + ? unmarshalOffer(data.onetime_fees) + : undefined, } as OfferFailoverIpInfo } @@ -323,23 +333,36 @@ const unmarshalOfferServerInfo = (data: unknown): OfferServerInfo => { } return { - availableOptions: unmarshalArrayOfObject(data.available_options, unmarshalOffer), + availableOptions: unmarshalArrayOfObject( + data.available_options, + unmarshalOffer, + ), bandwidth: data.bandwidth, commercialRange: data.commercial_range, connectivity: data.connectivity, cpus: unmarshalArrayOfObject(data.cpus, unmarshalCPU), disks: unmarshalArrayOfObject(data.disks, unmarshalDisk), memories: unmarshalArrayOfObject(data.memories, unmarshalMemory), - onetimeFees: data.onetime_fees ? unmarshalOffer(data.onetime_fees) : undefined, - persistentMemories: unmarshalArrayOfObject(data.persistent_memories, unmarshalPersistentMemory), - raidControllers: unmarshalArrayOfObject(data.raid_controllers, unmarshalRaidController), + onetimeFees: data.onetime_fees + ? unmarshalOffer(data.onetime_fees) + : undefined, + persistentMemories: unmarshalArrayOfObject( + data.persistent_memories, + unmarshalPersistentMemory, + ), + raidControllers: unmarshalArrayOfObject( + data.raid_controllers, + unmarshalRaidController, + ), rpnVersion: data.rpn_version, stock: data.stock, stockByDatacenter: data.stock_by_datacenter, } as OfferServerInfo } -const unmarshalOfferServiceLevelInfo = (data: unknown): OfferServiceLevelInfo => { +const unmarshalOfferServiceLevelInfo = ( + data: unknown, +): OfferServiceLevelInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OfferServiceLevelInfo' failed as data isn't a dictionary.`, @@ -348,7 +371,10 @@ const unmarshalOfferServiceLevelInfo = (data: unknown): OfferServiceLevelInfo => return { antidos: data.antidos, - availableOptions: unmarshalArrayOfObject(data.available_options, unmarshalOffer), + availableOptions: unmarshalArrayOfObject( + data.available_options, + unmarshalOffer, + ), customization: data.customization, extraFailoverQuota: data.extra_failover_quota, git: data.git, @@ -382,23 +408,43 @@ export const unmarshalOffer = (data: unknown): Offer => { } return { - antidosInfo: data.antidos_info ? unmarshalOfferAntiDosInfo(data.antidos_info) : undefined, - backupInfo: data.backup_info ? unmarshalOfferBackupInfo(data.backup_info) : undefined, - bandwidthInfo: data.bandwidth_info ? unmarshalOfferBandwidthInfo(data.bandwidth_info) : undefined, + antidosInfo: data.antidos_info + ? unmarshalOfferAntiDosInfo(data.antidos_info) + : undefined, + backupInfo: data.backup_info + ? unmarshalOfferBackupInfo(data.backup_info) + : undefined, + bandwidthInfo: data.bandwidth_info + ? unmarshalOfferBandwidthInfo(data.bandwidth_info) + : undefined, catalog: data.catalog, - failoverBlockInfo: data.failover_block_info ? unmarshalOfferFailoverBlockInfo(data.failover_block_info) : undefined, - failoverIpInfo: data.failover_ip_info ? unmarshalOfferFailoverIpInfo(data.failover_ip_info) : undefined, + failoverBlockInfo: data.failover_block_info + ? unmarshalOfferFailoverBlockInfo(data.failover_block_info) + : undefined, + failoverIpInfo: data.failover_ip_info + ? unmarshalOfferFailoverIpInfo(data.failover_ip_info) + : undefined, id: data.id, - licenseInfo: data.license_info ? unmarshalOfferLicenseInfo(data.license_info) : undefined, + licenseInfo: data.license_info + ? unmarshalOfferLicenseInfo(data.license_info) + : undefined, name: data.name, paymentFrequency: data.payment_frequency, pricing: data.pricing ? unmarshalMoney(data.pricing) : undefined, rpnInfo: data.rpn_info ? unmarshalOfferRPNInfo(data.rpn_info) : undefined, sanInfo: data.san_info ? unmarshalOfferSANInfo(data.san_info) : undefined, - serverInfo: data.server_info ? unmarshalOfferServerInfo(data.server_info) : undefined, - serviceLevelInfo: data.service_level_info ? unmarshalOfferServiceLevelInfo(data.service_level_info) : undefined, - storageInfo: data.storage_info ? unmarshalOfferStorageInfo(data.storage_info) : undefined, - usbStorageInfo: data.usb_storage_info ? unmarshalOfferStorageInfo(data.usb_storage_info) : undefined, + serverInfo: data.server_info + ? unmarshalOfferServerInfo(data.server_info) + : undefined, + serviceLevelInfo: data.service_level_info + ? unmarshalOfferServiceLevelInfo(data.service_level_info) + : undefined, + storageInfo: data.storage_info + ? unmarshalOfferStorageInfo(data.storage_info) + : undefined, + usbStorageInfo: data.usb_storage_info + ? unmarshalOfferStorageInfo(data.usb_storage_info) + : undefined, } as Offer } @@ -556,13 +602,18 @@ export const unmarshalServer = (data: unknown): Server => { hasBmc: data.has_bmc, hostname: data.hostname, id: data.id, - interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalNetworkInterface), + interfaces: unmarshalArrayOfObject( + data.interfaces, + unmarshalNetworkInterface, + ), ipv6Slaac: data.ipv6_slaac, isHds: data.is_hds, isOutsourced: data.is_outsourced, isRpnv2Member: data.is_rpnv2_member, level: data.level ? unmarshalServiceLevel(data.level) : undefined, - location: data.location ? unmarshalServerLocation(data.location) : undefined, + location: data.location + ? unmarshalServerLocation(data.location) + : undefined, offer: data.offer ? unmarshalOffer(data.offer) : undefined, options: unmarshalArrayOfObject(data.options, unmarshalServerOption), organizationId: data.organization_id, @@ -607,7 +658,9 @@ export const unmarshalRpnV2Group = (data: unknown): RpnV2Group => { organizationId: data.organization_id, owner: data.owner, projectId: data.project_id, - rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : undefined, + rpnv1Group: data.rpnv1_group + ? unmarshalRpnGroup(data.rpnv1_group) + : undefined, status: data.status, subnet: data.subnet ? unmarshalRpnV2GroupSubnet(data.subnet) : undefined, type: data.type, @@ -750,7 +803,9 @@ export const unmarshalCanOrderResponse = (data: unknown): CanOrderResponse => { } as CanOrderResponse } -export const unmarshalCreateFailoverIPsResponse = (data: unknown): CreateFailoverIPsResponse => { +export const unmarshalCreateFailoverIPsResponse = ( + data: unknown, +): CreateFailoverIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateFailoverIPsResponse' failed as data isn't a dictionary.`, @@ -763,7 +818,9 @@ export const unmarshalCreateFailoverIPsResponse = (data: unknown): CreateFailove } as CreateFailoverIPsResponse } -const unmarshalGetIPv6BlockQuotasResponseQuota = (data: unknown): GetIPv6BlockQuotasResponseQuota => { +const unmarshalGetIPv6BlockQuotasResponseQuota = ( + data: unknown, +): GetIPv6BlockQuotasResponseQuota => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetIPv6BlockQuotasResponseQuota' failed as data isn't a dictionary.`, @@ -776,7 +833,9 @@ const unmarshalGetIPv6BlockQuotasResponseQuota = (data: unknown): GetIPv6BlockQu } as GetIPv6BlockQuotasResponseQuota } -export const unmarshalGetIPv6BlockQuotasResponse = (data: unknown): GetIPv6BlockQuotasResponse => { +export const unmarshalGetIPv6BlockQuotasResponse = ( + data: unknown, +): GetIPv6BlockQuotasResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetIPv6BlockQuotasResponse' failed as data isn't a dictionary.`, @@ -784,12 +843,17 @@ export const unmarshalGetIPv6BlockQuotasResponse = (data: unknown): GetIPv6Block } return { - quotas: unmarshalArrayOfObject(data.quotas, unmarshalGetIPv6BlockQuotasResponseQuota), + quotas: unmarshalArrayOfObject( + data.quotas, + unmarshalGetIPv6BlockQuotasResponseQuota, + ), totalCount: data.total_count, } as GetIPv6BlockQuotasResponse } -export const unmarshalGetRemainingQuotaResponse = (data: unknown): GetRemainingQuotaResponse => { +export const unmarshalGetRemainingQuotaResponse = ( + data: unknown, +): GetRemainingQuotaResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetRemainingQuotaResponse' failed as data isn't a dictionary.`, @@ -804,7 +868,9 @@ export const unmarshalGetRemainingQuotaResponse = (data: unknown): GetRemainingQ } as GetRemainingQuotaResponse } -export const unmarshalGetRpnStatusResponse = (data: unknown): GetRpnStatusResponse => { +export const unmarshalGetRpnStatusResponse = ( + data: unknown, +): GetRpnStatusResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetRpnStatusResponse' failed as data isn't a dictionary.`, @@ -831,13 +897,19 @@ export const unmarshalInvoice = (data: unknown): Invoice => { paidAt: unmarshalDate(data.paid_at), paymentMethod: data.payment_method, status: data.status, - totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : undefined, - totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : undefined, + totalWithTaxes: data.total_with_taxes + ? unmarshalMoney(data.total_with_taxes) + : undefined, + totalWithoutTaxes: data.total_without_taxes + ? unmarshalMoney(data.total_without_taxes) + : undefined, transactionId: data.transaction_id, } as Invoice } -export const unmarshalListFailoverIPsResponse = (data: unknown): ListFailoverIPsResponse => { +export const unmarshalListFailoverIPsResponse = ( + data: unknown, +): ListFailoverIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFailoverIPsResponse' failed as data isn't a dictionary.`, @@ -850,7 +922,9 @@ export const unmarshalListFailoverIPsResponse = (data: unknown): ListFailoverIPs } as ListFailoverIPsResponse } -const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data: unknown): ListIPv6BlockSubnetsAvailableResponseSubnet => { +const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = ( + data: unknown, +): ListIPv6BlockSubnetsAvailableResponseSubnet => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponseSubnet' failed as data isn't a dictionary.`, @@ -863,7 +937,9 @@ const unmarshalListIPv6BlockSubnetsAvailableResponseSubnet = (data: unknown): Li } as ListIPv6BlockSubnetsAvailableResponseSubnet } -export const unmarshalListIPv6BlockSubnetsAvailableResponse = (data: unknown): ListIPv6BlockSubnetsAvailableResponse => { +export const unmarshalListIPv6BlockSubnetsAvailableResponse = ( + data: unknown, +): ListIPv6BlockSubnetsAvailableResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListIPv6BlockSubnetsAvailableResponse' failed as data isn't a dictionary.`, @@ -871,12 +947,17 @@ export const unmarshalListIPv6BlockSubnetsAvailableResponse = (data: unknown): L } return { - subnetAvailables: unmarshalArrayOfObject(data.subnet_availables, unmarshalListIPv6BlockSubnetsAvailableResponseSubnet), + subnetAvailables: unmarshalArrayOfObject( + data.subnet_availables, + unmarshalListIPv6BlockSubnetsAvailableResponseSubnet, + ), totalCount: data.total_count, } as ListIPv6BlockSubnetsAvailableResponse } -export const unmarshalListIPv6BlocksResponse = (data: unknown): ListIPv6BlocksResponse => { +export const unmarshalListIPv6BlocksResponse = ( + data: unknown, +): ListIPv6BlocksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListIPv6BlocksResponse' failed as data isn't a dictionary.`, @@ -902,13 +983,19 @@ const unmarshalInvoiceSummary = (data: unknown): InvoiceSummary => { paidAt: unmarshalDate(data.paid_at), paymentMethod: data.payment_method, status: data.status, - totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : undefined, - totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : undefined, + totalWithTaxes: data.total_with_taxes + ? unmarshalMoney(data.total_with_taxes) + : undefined, + totalWithoutTaxes: data.total_without_taxes + ? unmarshalMoney(data.total_without_taxes) + : undefined, transactionId: data.transaction_id, } as InvoiceSummary } -export const unmarshalListInvoicesResponse = (data: unknown): ListInvoicesResponse => { +export const unmarshalListInvoicesResponse = ( + data: unknown, +): ListInvoicesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInvoicesResponse' failed as data isn't a dictionary.`, @@ -957,7 +1044,9 @@ const unmarshalRpnSanIp = (data: unknown): RpnSanIp => { return { ip: data.ip ? unmarshalIP(data.ip) : undefined, - rpnv2Group: data.rpnv2_group ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) : undefined, + rpnv2Group: data.rpnv2_group + ? unmarshalRpnSanIpRpnV2Group(data.rpnv2_group) + : undefined, server: data.server ? unmarshalRpnSanIpServer(data.server) : undefined, type: data.type, } as RpnSanIp @@ -989,7 +1078,9 @@ export const unmarshalListOSResponse = (data: unknown): ListOSResponse => { } as ListOSResponse } -export const unmarshalListOffersResponse = (data: unknown): ListOffersResponse => { +export const unmarshalListOffersResponse = ( + data: unknown, +): ListOffersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`, @@ -1015,12 +1106,18 @@ const unmarshalRefundSummary = (data: unknown): RefundSummary => { method: data.method, refundedAt: unmarshalDate(data.refunded_at), status: data.status, - totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : undefined, - totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : undefined, + totalWithTaxes: data.total_with_taxes + ? unmarshalMoney(data.total_with_taxes) + : undefined, + totalWithoutTaxes: data.total_without_taxes + ? unmarshalMoney(data.total_without_taxes) + : undefined, } as RefundSummary } -export const unmarshalListRefundsResponse = (data: unknown): ListRefundsResponse => { +export const unmarshalListRefundsResponse = ( + data: unknown, +): ListRefundsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRefundsResponse' failed as data isn't a dictionary.`, @@ -1049,7 +1146,9 @@ const unmarshalRpnSanServer = (data: unknown): RpnSanServer => { } as RpnSanServer } -export const unmarshalListRpnCapableSanServersResponse = (data: unknown): ListRpnCapableSanServersResponse => { +export const unmarshalListRpnCapableSanServersResponse = ( + data: unknown, +): ListRpnCapableSanServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnCapableSanServersResponse' failed as data isn't a dictionary.`, @@ -1062,7 +1161,9 @@ export const unmarshalListRpnCapableSanServersResponse = (data: unknown): ListRp } as ListRpnCapableSanServersResponse } -export const unmarshalListRpnCapableServersResponse = (data: unknown): ListRpnCapableServersResponse => { +export const unmarshalListRpnCapableServersResponse = ( + data: unknown, +): ListRpnCapableServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnCapableServersResponse' failed as data isn't a dictionary.`, @@ -1088,14 +1189,18 @@ const unmarshalRpnGroupMember = (data: unknown): RpnGroupMember => { groupOwner: data.group_owner, id: data.id, owner: data.owner, - sanServer: data.san_server ? unmarshalRpnSanServer(data.san_server) : undefined, + sanServer: data.san_server + ? unmarshalRpnSanServer(data.san_server) + : undefined, server: data.server ? unmarshalServer(data.server) : undefined, speed: data.speed, status: data.status, } as RpnGroupMember } -export const unmarshalListRpnGroupMembersResponse = (data: unknown): ListRpnGroupMembersResponse => { +export const unmarshalListRpnGroupMembersResponse = ( + data: unknown, +): ListRpnGroupMembersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnGroupMembersResponse' failed as data isn't a dictionary.`, @@ -1108,7 +1213,9 @@ export const unmarshalListRpnGroupMembersResponse = (data: unknown): ListRpnGrou } as ListRpnGroupMembersResponse } -export const unmarshalListRpnGroupsResponse = (data: unknown): ListRpnGroupsResponse => { +export const unmarshalListRpnGroupsResponse = ( + data: unknown, +): ListRpnGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnGroupsResponse' failed as data isn't a dictionary.`, @@ -1121,7 +1228,9 @@ export const unmarshalListRpnGroupsResponse = (data: unknown): ListRpnGroupsResp } as ListRpnGroupsResponse } -export const unmarshalListRpnInvitesResponse = (data: unknown): ListRpnInvitesResponse => { +export const unmarshalListRpnInvitesResponse = ( + data: unknown, +): ListRpnInvitesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnInvitesResponse' failed as data isn't a dictionary.`, @@ -1161,7 +1270,9 @@ const unmarshalRpnSanSummary = (data: unknown): RpnSanSummary => { } as RpnSanSummary } -export const unmarshalListRpnSansResponse = (data: unknown): ListRpnSansResponse => { +export const unmarshalListRpnSansResponse = ( + data: unknown, +): ListRpnSansResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnSansResponse' failed as data isn't a dictionary.`, @@ -1196,7 +1307,9 @@ const unmarshalRpnServerCapability = (data: unknown): RpnServerCapability => { } as RpnServerCapability } -export const unmarshalListRpnServerCapabilitiesResponse = (data: unknown): ListRpnServerCapabilitiesResponse => { +export const unmarshalListRpnServerCapabilitiesResponse = ( + data: unknown, +): ListRpnServerCapabilitiesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnServerCapabilitiesResponse' failed as data isn't a dictionary.`, @@ -1209,7 +1322,9 @@ export const unmarshalListRpnServerCapabilitiesResponse = (data: unknown): ListR } as ListRpnServerCapabilitiesResponse } -export const unmarshalListRpnV2CapableResourcesResponse = (data: unknown): ListRpnV2CapableResourcesResponse => { +export const unmarshalListRpnV2CapableResourcesResponse = ( + data: unknown, +): ListRpnV2CapableResourcesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnV2CapableResourcesResponse' failed as data isn't a dictionary.`, @@ -1231,7 +1346,9 @@ const unmarshalRpnV2Member = (data: unknown): RpnV2Member => { return { id: data.id, - rpnv1Group: data.rpnv1_group ? unmarshalRpnGroup(data.rpnv1_group) : undefined, + rpnv1Group: data.rpnv1_group + ? unmarshalRpnGroup(data.rpnv1_group) + : undefined, server: data.server ? unmarshalServer(data.server) : undefined, speed: data.speed, status: data.status, @@ -1257,7 +1374,9 @@ const unmarshalLog = (data: unknown): Log => { } as Log } -export const unmarshalListRpnV2GroupLogsResponse = (data: unknown): ListRpnV2GroupLogsResponse => { +export const unmarshalListRpnV2GroupLogsResponse = ( + data: unknown, +): ListRpnV2GroupLogsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnV2GroupLogsResponse' failed as data isn't a dictionary.`, @@ -1270,7 +1389,9 @@ export const unmarshalListRpnV2GroupLogsResponse = (data: unknown): ListRpnV2Gro } as ListRpnV2GroupLogsResponse } -export const unmarshalListRpnV2GroupsResponse = (data: unknown): ListRpnV2GroupsResponse => { +export const unmarshalListRpnV2GroupsResponse = ( + data: unknown, +): ListRpnV2GroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnV2GroupsResponse' failed as data isn't a dictionary.`, @@ -1283,7 +1404,9 @@ export const unmarshalListRpnV2GroupsResponse = (data: unknown): ListRpnV2Groups } as ListRpnV2GroupsResponse } -export const unmarshalListRpnV2MembersResponse = (data: unknown): ListRpnV2MembersResponse => { +export const unmarshalListRpnV2MembersResponse = ( + data: unknown, +): ListRpnV2MembersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRpnV2MembersResponse' failed as data isn't a dictionary.`, @@ -1312,7 +1435,9 @@ const unmarshalServerDisk = (data: unknown): ServerDisk => { } as ServerDisk } -export const unmarshalListServerDisksResponse = (data: unknown): ListServerDisksResponse => { +export const unmarshalListServerDisksResponse = ( + data: unknown, +): ListServerDisksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerDisksResponse' failed as data isn't a dictionary.`, @@ -1339,7 +1464,9 @@ const unmarshalServerEvent = (data: unknown): ServerEvent => { } as ServerEvent } -export const unmarshalListServerEventsResponse = (data: unknown): ListServerEventsResponse => { +export const unmarshalListServerEventsResponse = ( + data: unknown, +): ListServerEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerEventsResponse' failed as data isn't a dictionary.`, @@ -1365,7 +1492,10 @@ const unmarshalServerSummary = (data: unknown): ServerSummary => { expiredAt: unmarshalDate(data.expired_at), hostname: data.hostname, id: data.id, - interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalNetworkInterface), + interfaces: unmarshalArrayOfObject( + data.interfaces, + unmarshalNetworkInterface, + ), isHds: data.is_hds, isOutsourced: data.is_outsourced, level: data.level ? unmarshalServiceLevel(data.level) : undefined, @@ -1382,7 +1512,9 @@ const unmarshalServerSummary = (data: unknown): ServerSummary => { } as ServerSummary } -export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { +export const unmarshalListServersResponse = ( + data: unknown, +): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -1395,7 +1527,9 @@ export const unmarshalListServersResponse = (data: unknown): ListServersResponse } as ListServersResponse } -export const unmarshalListServicesResponse = (data: unknown): ListServicesResponse => { +export const unmarshalListServicesResponse = ( + data: unknown, +): ListServicesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServicesResponse' failed as data isn't a dictionary.`, @@ -1408,7 +1542,9 @@ export const unmarshalListServicesResponse = (data: unknown): ListServicesRespon } as ListServicesResponse } -export const unmarshalListSubscribableServerOptionsResponse = (data: unknown): ListSubscribableServerOptionsResponse => { +export const unmarshalListSubscribableServerOptionsResponse = ( + data: unknown, +): ListSubscribableServerOptionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSubscribableServerOptionsResponse' failed as data isn't a dictionary.`, @@ -1460,8 +1596,12 @@ export const unmarshalRefund = (data: unknown): Refund => { method: data.method, refundedAt: unmarshalDate(data.refunded_at), status: data.status, - totalWithTaxes: data.total_with_taxes ? unmarshalMoney(data.total_with_taxes) : undefined, - totalWithoutTaxes: data.total_without_taxes ? unmarshalMoney(data.total_without_taxes) : undefined, + totalWithTaxes: data.total_with_taxes + ? unmarshalMoney(data.total_with_taxes) + : undefined, + totalWithoutTaxes: data.total_without_taxes + ? unmarshalMoney(data.total_without_taxes) + : undefined, } as Refund } @@ -1497,7 +1637,9 @@ const unmarshalPartition = (data: unknown): Partition => { } as Partition } -export const unmarshalServerDefaultPartitioning = (data: unknown): ServerDefaultPartitioning => { +export const unmarshalServerDefaultPartitioning = ( + data: unknown, +): ServerDefaultPartitioning => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerDefaultPartitioning' failed as data isn't a dictionary.`, @@ -1527,7 +1669,9 @@ export const unmarshalServerInstall = (data: unknown): ServerInstall => { } as ServerInstall } -export const unmarshalSubscribeStorageOptionsResponse = (data: unknown): SubscribeStorageOptionsResponse => { +export const unmarshalSubscribeStorageOptionsResponse = ( + data: unknown, +): SubscribeStorageOptionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SubscribeStorageOptionsResponse' failed as data isn't a dictionary.`, @@ -1623,7 +1767,10 @@ export const marshalInstallServerRequest = ( license_offer_id: request.licenseOfferId, os_id: request.osId, panel_password: request.panelPassword, - partitions: ((request.partitions !== undefined) ? request.partitions.map(elt => marshalInstallPartition(elt, defaults)): undefined), + partitions: + request.partitions !== undefined + ? request.partitions.map(elt => marshalInstallPartition(elt, defaults)) + : undefined, root_password: request.rootPassword, ssh_key_ids: request.sshKeyIds, user_login: request.userLogin, @@ -1785,7 +1932,9 @@ export const marshalUpdateRaidRequest = ( request: UpdateRaidRequest, defaults: DefaultValues, ): Record => ({ - raid_arrays: request.raidArrays.map(elt => marshalUpdatableRaidArray(elt, defaults)), + raid_arrays: request.raidArrays.map(elt => + marshalUpdatableRaidArray(elt, defaults), + ), }) export const marshalUpdateReverseRequest = ( diff --git a/packages_generated/dedibox/src/v1/types.gen.ts b/packages_generated/dedibox/src/v1/types.gen.ts index b76cff4d8..a889ac359 100644 --- a/packages_generated/dedibox/src/v1/types.gen.ts +++ b/packages_generated/dedibox/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Money, Zone as ScwZone } from '@scaleway/sdk-client' export type AttachFailoverIPToMacAddressRequestMacType = | 'mac_type_unknown' @@ -9,11 +8,7 @@ export type AttachFailoverIPToMacAddressRequestMacType = | 'kvm' | 'xen' -export type BMCAccessStatus = - | 'unknown' - | 'creating' - | 'created' - | 'deleting' +export type BMCAccessStatus = 'unknown' | 'creating' | 'created' | 'deleting' export type BackupStatus = | 'unknown_backup_status' @@ -21,27 +16,13 @@ export type BackupStatus = | 'inactive' | 'ready' -export type FailoverBlockVersion = - | 'unknown_version' - | 'ipv4' - | 'ipv6' +export type FailoverBlockVersion = 'unknown_version' | 'ipv4' | 'ipv6' -export type FailoverIPInterfaceType = - | 'unknown' - | 'normal' - | 'ipmi' - | 'virtual' +export type FailoverIPInterfaceType = 'unknown' | 'normal' | 'ipmi' | 'virtual' -export type FailoverIPStatus = - | 'unknown_status' - | 'ready' - | 'busy' - | 'locked' +export type FailoverIPStatus = 'unknown_status' | 'ready' | 'busy' | 'locked' -export type FailoverIPVersion = - | 'unknown_version' - | 'ipv4' - | 'ipv6' +export type FailoverIPVersion = 'unknown_version' | 'ipv4' | 'ipv6' export type GetRpnStatusResponseStatus = | 'unknown_status' @@ -59,20 +40,11 @@ export type IPSemantic = | 'redirect' | 'migration' -export type IPStatus = - | 'unknown_status' - | 'ready' - | 'busy' - | 'locked' +export type IPStatus = 'unknown_status' | 'ready' | 'busy' | 'locked' -export type IPVersion = - | 'ipv4' - | 'ipv6' +export type IPVersion = 'ipv4' | 'ipv6' -export type IPv6BlockDelegationStatus = - | 'unknown_status' - | 'updating' - | 'done' +export type IPv6BlockDelegationStatus = 'unknown_status' | 'updating' | 'done' export type InvoicePaymentMethod = | 'unknown_payment_method' @@ -88,13 +60,9 @@ export type InvoiceStatus = | 'paid' | 'errored' -export type ListFailoverIPsRequestOrderBy = - | 'ip_asc' - | 'ip_desc' +export type ListFailoverIPsRequestOrderBy = 'ip_asc' | 'ip_desc' -export type ListInvoicesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListInvoicesRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListOSRequestOrderBy = | 'created_at_asc' @@ -110,9 +78,7 @@ export type ListOffersRequestOrderBy = | 'price_asc' | 'price_desc' -export type ListRefundsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRefundsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListRpnCapableSanServersRequestOrderBy = | 'created_at_asc' @@ -126,17 +92,11 @@ export type ListRpnGroupMembersRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListRpnGroupsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRpnGroupsRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListRpnInvitesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRpnInvitesRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListRpnSansRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRpnSansRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListRpnServerCapabilitiesRequestOrderBy = | 'created_at_asc' @@ -150,9 +110,7 @@ export type ListRpnV2GroupLogsRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListRpnV2GroupsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRpnV2GroupsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListRpnV2MembersRequestOrderBy = | 'created_at_asc' @@ -163,21 +121,15 @@ export type ListRpnV2MembersRequestType = | 'rpnv1_group' | 'server' -export type ListServerDisksRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListServerDisksRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListServerEventsRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListServersRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListServicesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListServicesRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type LogAction = | 'unknown_log_action' @@ -197,11 +149,7 @@ export type LogStatus = | 'in_progress' | 'error' -export type MemoryType = - | 'ddr2' - | 'ddr3' - | 'ddr4' - | 'ddr5' +export type MemoryType = 'ddr2' | 'ddr3' | 'ddr4' | 'ddr5' export type NetworkInterfaceInterfaceType = | 'unknown' @@ -209,12 +157,7 @@ export type NetworkInterfaceInterfaceType = | 'ipmi' | 'virtual' -export type OSArch = - | 'unknown_arch' - | 'amd64' - | 'x86' - | 'arm' - | 'arm64' +export type OSArch = 'unknown_arch' | 'amd64' | 'x86' | 'arm' | 'arm64' export type OSType = | 'unknown_type' @@ -225,10 +168,7 @@ export type OSType = | 'custom' | 'rescue' -export type OfferAntiDosInfoType = - | 'minimal' - | 'preventive' - | 'curative' +export type OfferAntiDosInfoType = 'minimal' | 'preventive' | 'curative' export type OfferCatalog = | 'all' @@ -240,18 +180,11 @@ export type OfferCatalog = | 'admin' | 'inactive' -export type OfferPaymentFrequency = - | 'monthly' - | 'oneshot' +export type OfferPaymentFrequency = 'monthly' | 'oneshot' -export type OfferSANInfoType = - | 'hdd' - | 'ssd' +export type OfferSANInfoType = 'hdd' | 'ssd' -export type OfferServerInfoStock = - | 'empty' - | 'low' - | 'available' +export type OfferServerInfoStock = 'empty' | 'low' | 'available' export type PartitionFileSystem = | 'unknown' @@ -265,10 +198,7 @@ export type PartitionFileSystem = | 'fat32' | 'ufs' -export type PartitionType = - | 'primary' - | 'extended' - | 'logical' +export type PartitionType = 'primary' | 'extended' | 'logical' export type RaidArrayRaidLevel = | 'no_raid' @@ -291,9 +221,7 @@ export type RefundStatus = | 'paid' | 'errored' -export type RescueProtocol = - | 'vnc' - | 'ssh' +export type RescueProtocol = 'vnc' | 'ssh' export type RpnGroupMemberStatus = | 'unknown_rpn_member_status' @@ -303,15 +231,9 @@ export type RpnGroupMemberStatus = | 'deleting' | 'deleted' -export type RpnGroupType = - | 'unknown' - | 'local' - | 'shared' +export type RpnGroupType = 'unknown' | 'local' | 'shared' -export type RpnSanIpType = - | 'unknown' - | 'server_ip' - | 'rpnv2_subnet' +export type RpnSanIpType = 'unknown' | 'server_ip' | 'rpnv2_subnet' export type RpnSanStatus = | 'unknown_status' @@ -327,10 +249,7 @@ export type RpnV2GroupStatus = | 'updating' | 'deleting' -export type RpnV2GroupType = - | 'unknown_type' - | 'standard' - | 'qinq' +export type RpnV2GroupType = 'unknown_type' | 'standard' | 'qinq' export type RpnV2MemberStatus = | 'unknown_member_status' @@ -339,13 +258,7 @@ export type RpnV2MemberStatus = | 'updating' | 'deleting' -export type ServerDiskType = - | 'sata' - | 'ssd' - | 'sas' - | 'sshd' - | 'usb' - | 'nvme' +export type ServerDiskType = 'sata' | 'ssd' | 'sas' | 'sshd' | 'usb' | 'nvme' export type ServerInstallStatus = | 'unknown' @@ -370,10 +283,7 @@ export type ServerStatus = | 'rescue' | 'busy' -export type ServiceLevelLevel = - | 'unknown' - | 'basic' - | 'business' +export type ServiceLevelLevel = 'unknown' | 'basic' | 'business' export type ServiceProvisioningStatus = | 'unknown' @@ -383,36 +293,28 @@ export type ServiceProvisioningStatus = | 'expiring' | 'expired' -export type ServiceType = - | 'unknown_type' - | 'service' - | 'order' +export type ServiceType = 'unknown_type' | 'service' | 'order' export interface OfferAntiDosInfo { type: OfferAntiDosInfoType } - export interface OfferBackupInfo { size: number } - export interface OfferBandwidthInfo { speed: number } - export interface OfferLicenseInfo { boundToIp: boolean } - export interface OfferRPNInfo { speed: number } - export interface OfferSANInfo { /** * SAN size (in bytes). @@ -428,13 +330,11 @@ export interface OfferSANInfo { deviceType: OfferSANInfoType } - export interface OfferStorageInfo { maxQuota: number size: number } - export interface IP { /** * ID of the IP. @@ -474,7 +374,6 @@ export interface IP { status: IPStatus } - export interface Offer { /** * ID of the offer. @@ -570,7 +469,6 @@ export interface Offer { bandwidthInfo?: OfferBandwidthInfo } - export interface NetworkInterface { /** * Card ID of the network interface. @@ -594,7 +492,6 @@ export interface NetworkInterface { ips: IP[] } - export interface OS { /** * ID of the OS. @@ -682,14 +579,12 @@ export interface OS { releasedAt?: Date } - export interface ServerLocation { rack: string room: string datacenterName: string } - export interface ServerOption { offer?: Offer createdAt?: Date @@ -698,7 +593,6 @@ export interface ServerOption { options: ServerOption[] } - export interface ServiceLevel { /** * Offer ID of service level. @@ -710,7 +604,6 @@ export interface ServiceLevel { level: ServiceLevelLevel } - export interface RpnSan { /** * RPN SAN ID. @@ -780,7 +673,6 @@ export interface RpnSan { expiresAt?: Date } - export interface RpnGroup { /** * Rpn group member ID. @@ -820,13 +712,11 @@ export interface RpnGroup { projectId: string } - export interface RpnV2GroupSubnet { address: string cidr: number } - export interface Server { /** * ID of the server. @@ -930,7 +820,6 @@ export interface Server { isHds: boolean } - export interface FailoverBlock { /** * ID of the failover block. @@ -962,20 +851,17 @@ export interface FailoverBlock { gatewayIp: string } - export interface RpnSanIpRpnV2Group { id: number name: string } - export interface RpnSanIpServer { id: number hostname: string datacenterName: string } - export interface RpnSanServer { /** * The RPN SAN server ID. @@ -999,7 +885,6 @@ export interface RpnSanServer { zone: ScwZone } - export interface RpnV2Group { /** * RPN V2 group ID. @@ -1051,7 +936,6 @@ export interface RpnV2Group { rpnv1Group?: RpnGroup } - export interface RpnV2Member { /** * RPN V2 member ID. @@ -1083,7 +967,6 @@ export interface RpnV2Member { speed?: number } - export interface ServerDisk { id: number connector: string @@ -1092,7 +975,6 @@ export interface ServerDisk { isAddon: boolean } - export interface Service { /** * ID of the service. @@ -1132,13 +1014,11 @@ export interface Service { type: ServiceType } - export interface GetIPv6BlockQuotasResponseQuota { quota: number cidr: number } - export interface InstallPartition { /** * File system of the installation partition. @@ -1162,7 +1042,6 @@ export interface InstallPartition { connectors: string[] } - export interface FailoverIP { /** * ID of the failover IP. @@ -1218,13 +1097,11 @@ export interface FailoverIP { serverZone?: string } - export interface ListIPv6BlockSubnetsAvailableResponseSubnet { address: string cidr: number } - export interface IPv6Block { /** * ID of the IPv6. @@ -1256,7 +1133,6 @@ export interface IPv6Block { delegationStatus: IPv6BlockDelegationStatus } - export interface InvoiceSummary { id: number totalWithTaxes?: Money @@ -1268,7 +1144,6 @@ export interface InvoiceSummary { transactionId: number } - export interface RpnSanIp { /** * Basic server information behind the IP. @@ -1292,7 +1167,6 @@ export interface RpnSanIp { type: RpnSanIpType } - export interface RefundSummary { id: number totalWithTaxes?: Money @@ -1303,7 +1177,6 @@ export interface RefundSummary { method: RefundMethod } - export interface RpnGroupMember { /** * Rpn group member ID. @@ -1343,7 +1216,6 @@ export interface RpnGroupMember { owner: string } - export interface RpnSanSummary { /** * RPN SAN ID. @@ -1411,7 +1283,6 @@ export interface RpnSanSummary { expiresAt?: Date } - export interface RpnServerCapability { /** * Server ID. @@ -1459,7 +1330,6 @@ export interface RpnServerCapability { canJoinRpnv2Group: boolean } - export interface Log { /** * RPN V2 log ID. @@ -1491,7 +1361,6 @@ export interface Log { finishedAt?: Date } - export interface ServerEvent { /** * ID of the event. @@ -1507,7 +1376,6 @@ export interface ServerEvent { date?: Date } - export interface ServerSummary { /** * ID of the server. @@ -1587,7 +1455,6 @@ export interface ServerSummary { isHds: boolean } - export interface CPU { /** * Name of CPU. @@ -1607,7 +1474,6 @@ export interface CPU { frequency: number } - export interface Disk { /** * Capacity of the disk. @@ -1619,7 +1485,6 @@ export interface Disk { type: ServerDiskType } - export interface Memory { /** * Capacity of the memory. @@ -1639,7 +1504,6 @@ export interface Memory { isEcc: boolean } - export interface PersistentMemory { /** * Capacity of the persistent memory. @@ -1655,7 +1519,6 @@ export interface PersistentMemory { model: string } - export interface RaidController { /** * Model of the RAID controller. @@ -1667,7 +1530,6 @@ export interface RaidController { raidLevel: string[] } - export interface RaidArray { /** * The RAID level. @@ -1679,7 +1541,6 @@ export interface RaidArray { disks: ServerDisk[] } - export interface Partition { /** * Type of the partition. @@ -1707,7 +1568,6 @@ export interface Partition { connectors: string[] } - export interface UpdatableRaidArray { /** * The RAID level. @@ -1719,7 +1579,6 @@ export interface UpdatableRaidArray { diskIds: number[] } - export type AttachFailoverIPToMacAddressRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1739,7 +1598,6 @@ export type AttachFailoverIPToMacAddressRequest = { mac?: string } - export type AttachFailoverIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1755,7 +1613,6 @@ export type AttachFailoverIPsRequest = { fipsIds: number[] } - export interface BMCAccess { /** * URL to access to the server console. @@ -1779,7 +1636,6 @@ export interface BMCAccess { status: BMCAccessStatus } - export interface Backup { /** * ID of the backup. @@ -1823,32 +1679,26 @@ export interface Backup { quotaFilesUsed: number } - export type BillingApiCanOrderRequest = { projectId?: string } - export type BillingApiDownloadInvoiceRequest = { invoiceId: number } - export type BillingApiDownloadRefundRequest = { refundId: number } - export type BillingApiGetInvoiceRequest = { invoiceId: number } - export type BillingApiGetRefundRequest = { refundId: number } - export type BillingApiListInvoicesRequest = { page?: number pageSize?: number @@ -1856,7 +1706,6 @@ export type BillingApiListInvoicesRequest = { projectId?: string } - export type BillingApiListRefundsRequest = { page?: number pageSize?: number @@ -1864,7 +1713,6 @@ export type BillingApiListRefundsRequest = { projectId?: string } - export interface CanOrderResponse { canOrder: boolean message?: string @@ -1876,7 +1724,6 @@ export interface CanOrderResponse { billingOk: boolean } - export type CancelServerInstallRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1888,7 +1735,6 @@ export type CancelServerInstallRequest = { serverId: number } - export type CreateFailoverIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1908,13 +1754,11 @@ export type CreateFailoverIPsRequest = { quantity: number } - export interface CreateFailoverIPsResponse { totalCount: number services: Service[] } - export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1938,7 +1782,6 @@ export type CreateServerRequest = { datacenterName?: string } - export type DeleteFailoverIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1950,7 +1793,6 @@ export type DeleteFailoverIPRequest = { ipId: number } - export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1962,7 +1804,6 @@ export type DeleteServerRequest = { serverId: number } - export type DeleteServiceRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1974,7 +1815,6 @@ export type DeleteServiceRequest = { serviceId: number } - export type DetachFailoverIPFromMacAddressRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1986,7 +1826,6 @@ export type DetachFailoverIPFromMacAddressRequest = { ipId: number } - export type DetachFailoverIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1998,7 +1837,6 @@ export type DetachFailoverIPsRequest = { fipsIds: number[] } - export type GetBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2010,7 +1848,6 @@ export type GetBMCAccessRequest = { serverId: number } - export type GetFailoverIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2022,7 +1859,6 @@ export type GetFailoverIPRequest = { ipId: number } - export interface GetIPv6BlockQuotasResponse { /** * Quota for each CIDR of IPv6 block. @@ -2034,7 +1870,6 @@ export interface GetIPv6BlockQuotasResponse { totalCount: number } - export type GetOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2054,7 +1889,6 @@ export type GetOSRequest = { projectId?: string } - export type GetOfferRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2070,7 +1904,6 @@ export type GetOfferRequest = { projectId?: string } - export type GetOrderedServiceRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2079,7 +1912,6 @@ export type GetOrderedServiceRequest = { orderedServiceId: number } - export type GetRaidRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2091,7 +1923,6 @@ export type GetRaidRequest = { serverId: number } - export type GetRemainingQuotaRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2103,7 +1934,6 @@ export type GetRemainingQuotaRequest = { projectId?: string } - export interface GetRemainingQuotaResponse { /** * Current failover IP quota. @@ -2123,7 +1953,6 @@ export interface GetRemainingQuotaResponse { failoverBlockRemainingQuota: number } - export type GetRescueRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2135,7 +1964,6 @@ export type GetRescueRequest = { serverId: number } - export interface GetRpnStatusResponse { /** * If status = 'operational', you can perform rpn actions in write. @@ -2147,7 +1975,6 @@ export interface GetRpnStatusResponse { operationsLeft?: number } - export type GetServerBackupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2159,7 +1986,6 @@ export type GetServerBackupRequest = { serverId: number } - export type GetServerDefaultPartitioningRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2175,7 +2001,6 @@ export type GetServerDefaultPartitioningRequest = { osId: number } - export type GetServerInstallRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2187,7 +2012,6 @@ export type GetServerInstallRequest = { serverId: number } - export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2199,7 +2023,6 @@ export type GetServerRequest = { serverId: number } - export type GetServiceRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2211,7 +2034,6 @@ export type GetServiceRequest = { serviceId: number } - export type IPv6BlockApiCreateIPv6BlockRequest = { /** * ID of the project. @@ -2219,7 +2041,6 @@ export type IPv6BlockApiCreateIPv6BlockRequest = { projectId?: string } - export type IPv6BlockApiCreateIPv6BlockSubnetRequest = { /** * ID of the IPv6 block. @@ -2235,7 +2056,6 @@ export type IPv6BlockApiCreateIPv6BlockSubnetRequest = { cidr: number } - export type IPv6BlockApiDeleteIPv6BlockRequest = { /** * ID of the IPv6 block to delete. @@ -2243,7 +2063,6 @@ export type IPv6BlockApiDeleteIPv6BlockRequest = { blockId: number } - export type IPv6BlockApiGetIPv6BlockQuotasRequest = { /** * ID of the project. @@ -2251,7 +2070,6 @@ export type IPv6BlockApiGetIPv6BlockQuotasRequest = { projectId?: string } - export type IPv6BlockApiGetIPv6BlockRequest = { /** * ID of the project. @@ -2259,7 +2077,6 @@ export type IPv6BlockApiGetIPv6BlockRequest = { projectId?: string } - export type IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = { /** * ID of the IPv6 block. @@ -2267,12 +2084,10 @@ export type IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = { blockId: number } - export type IPv6BlockApiListIPv6BlocksRequest = { projectId?: string } - export type IPv6BlockApiUpdateIPv6BlockRequest = { /** * ID of the IPv6 block. @@ -2284,7 +2099,6 @@ export type IPv6BlockApiUpdateIPv6BlockRequest = { nameservers?: string[] } - export type InstallServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2336,7 +2150,6 @@ export type InstallServerRequest = { ipId?: number } - export interface Invoice { id: number totalWithTaxes?: Money @@ -2349,7 +2162,6 @@ export interface Invoice { transactionId: number } - export type ListFailoverIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2382,7 +2194,6 @@ false: return all failovers IP attached on server. onlyAvailable?: boolean } - export interface ListFailoverIPsResponse { /** * Total count of matching failovers IP. @@ -2394,7 +2205,6 @@ export interface ListFailoverIPsResponse { failoverIps: FailoverIP[] } - export interface ListIPv6BlockSubnetsAvailableResponse { /** * All available address and CIDR available in subnet. @@ -2406,19 +2216,16 @@ export interface ListIPv6BlockSubnetsAvailableResponse { totalCount: number } - export interface ListIPv6BlocksResponse { totalCount: number ipv6Blocks: IPv6Block[] } - export interface ListInvoicesResponse { totalCount: number invoices: InvoiceSummary[] } - export interface ListIpsResponse { /** * Total count of authorized IPs. @@ -2430,7 +2237,6 @@ export interface ListIpsResponse { ips: RpnSanIp[] } - export type ListOSRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2462,7 +2268,6 @@ export type ListOSRequest = { projectId?: string } - export interface ListOSResponse { /** * Total count of matching OS. @@ -2474,7 +2279,6 @@ export interface ListOSResponse { os: OS[] } - export type ListOffersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2526,7 +2330,6 @@ export type ListOffersRequest = { isRpnSan?: boolean } - export interface ListOffersResponse { /** * Total count of matching offers. @@ -2538,13 +2341,11 @@ export interface ListOffersResponse { offers: Offer[] } - export interface ListRefundsResponse { totalCount: number refunds: RefundSummary[] } - export interface ListRpnCapableSanServersResponse { /** * Total count of rpn capable san servers. @@ -2556,7 +2357,6 @@ export interface ListRpnCapableSanServersResponse { sanServers: RpnSanServer[] } - export interface ListRpnCapableServersResponse { /** * Total count of rpn capable servers. @@ -2568,7 +2368,6 @@ export interface ListRpnCapableServersResponse { servers: Server[] } - export interface ListRpnGroupMembersResponse { /** * Total count of rpn v1 group members. @@ -2580,7 +2379,6 @@ export interface ListRpnGroupMembersResponse { members: RpnGroupMember[] } - export interface ListRpnGroupsResponse { /** * Total count of rpn groups. @@ -2592,7 +2390,6 @@ export interface ListRpnGroupsResponse { rpnGroups: RpnGroup[] } - export interface ListRpnInvitesResponse { /** * Total count of invites. @@ -2604,7 +2401,6 @@ export interface ListRpnInvitesResponse { members: RpnGroupMember[] } - export interface ListRpnSansResponse { /** * Total count of matching RPN SANs. @@ -2616,7 +2412,6 @@ export interface ListRpnSansResponse { rpnSans: RpnSanSummary[] } - export interface ListRpnServerCapabilitiesResponse { /** * Total count of servers. @@ -2628,7 +2423,6 @@ export interface ListRpnServerCapabilitiesResponse { servers: RpnServerCapability[] } - export interface ListRpnV2CapableResourcesResponse { /** * Total count of matching rpn v2 capable resources. @@ -2640,7 +2434,6 @@ export interface ListRpnV2CapableResourcesResponse { servers: Server[] } - export interface ListRpnV2GroupLogsResponse { /** * Total count of matching rpn v2 logs. @@ -2652,7 +2445,6 @@ export interface ListRpnV2GroupLogsResponse { logs: Log[] } - export interface ListRpnV2GroupsResponse { /** * Total count of matching rpn v2 groups. @@ -2664,7 +2456,6 @@ export interface ListRpnV2GroupsResponse { rpnGroups: RpnV2Group[] } - export interface ListRpnV2MembersResponse { /** * Total count of matching rpn v2 group members. @@ -2676,7 +2467,6 @@ export interface ListRpnV2MembersResponse { members: RpnV2Member[] } - export type ListServerDisksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2700,7 +2490,6 @@ export type ListServerDisksRequest = { orderBy?: ListServerDisksRequestOrderBy } - export interface ListServerDisksResponse { /** * Total count of matching server disks. @@ -2712,7 +2501,6 @@ export interface ListServerDisksResponse { disks: ServerDisk[] } - export type ListServerEventsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2736,7 +2524,6 @@ export type ListServerEventsRequest = { orderBy?: ListServerEventsRequestOrderBy } - export interface ListServerEventsResponse { /** * Total count of matching server events. @@ -2748,7 +2535,6 @@ export interface ListServerEventsResponse { events: ServerEvent[] } - export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2776,7 +2562,6 @@ export type ListServersRequest = { search?: string } - export interface ListServersResponse { /** * Total count of matching servers. @@ -2788,7 +2573,6 @@ export interface ListServersResponse { servers: ServerSummary[] } - export type ListServicesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2812,7 +2596,6 @@ export type ListServicesRequest = { projectId?: string } - export interface ListServicesResponse { /** * Total count of matching services. @@ -2824,7 +2607,6 @@ export interface ListServicesResponse { services: Service[] } - export type ListSubscribableServerOptionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2844,7 +2626,6 @@ export type ListSubscribableServerOptionsRequest = { pageSize?: number } - export interface ListSubscribableServerOptionsResponse { /** * Total count of matching subscribable server options. @@ -2856,17 +2637,14 @@ export interface ListSubscribableServerOptionsResponse { serverOptions: Offer[] } - export interface OfferFailoverBlockInfo { onetimeFees?: Offer } - export interface OfferFailoverIpInfo { onetimeFees?: Offer } - export interface OfferServerInfo { bandwidth: number stock: OfferServerInfoStock @@ -2883,7 +2661,6 @@ export interface OfferServerInfo { stockByDatacenter: Record } - export interface OfferServiceLevelInfo { supportTicket: boolean supportPhone: boolean @@ -2898,7 +2675,6 @@ export interface OfferServiceLevelInfo { availableOptions: Offer[] } - export interface Raid { /** * Details about the RAID controller. @@ -2906,7 +2682,6 @@ export interface Raid { raidArrays: RaidArray[] } - export type RebootServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2918,7 +2693,6 @@ export type RebootServerRequest = { serverId: number } - export interface Refund { id: number totalWithTaxes?: Money @@ -2930,7 +2704,6 @@ export interface Refund { content: string } - export interface Rescue { /** * OS ID of the rescue. @@ -2950,7 +2723,6 @@ export interface Rescue { protocol: RescueProtocol } - export type RpnApiGetRpnStatusRequest = { /** * A project ID. @@ -2966,7 +2738,6 @@ export type RpnApiGetRpnStatusRequest = { rpnv2GroupId?: number } - export type RpnApiListRpnServerCapabilitiesRequest = { /** * Page number. @@ -2986,7 +2757,6 @@ export type RpnApiListRpnServerCapabilitiesRequest = { projectId?: string } - export type RpnSanApiAddIpRequest = { /** * RPN SAN ID. @@ -2998,7 +2768,6 @@ export type RpnSanApiAddIpRequest = { ipIds: number[] } - export type RpnSanApiCreateRpnSanRequest = { /** * Offer ID. @@ -3010,7 +2779,6 @@ export type RpnSanApiCreateRpnSanRequest = { projectId?: string } - export type RpnSanApiDeleteRpnSanRequest = { /** * RPN SAN ID. @@ -3018,7 +2786,6 @@ export type RpnSanApiDeleteRpnSanRequest = { rpnSanId: number } - export type RpnSanApiGetRpnSanRequest = { /** * RPN SAN ID. @@ -3026,7 +2793,6 @@ export type RpnSanApiGetRpnSanRequest = { rpnSanId: number } - export type RpnSanApiListAvailableIpsRequest = { /** * RPN SAN ID. @@ -3038,7 +2804,6 @@ export type RpnSanApiListAvailableIpsRequest = { type?: RpnSanIpType } - export type RpnSanApiListIpsRequest = { /** * RPN SAN ID. @@ -3050,7 +2815,6 @@ export type RpnSanApiListIpsRequest = { type?: RpnSanIpType } - export type RpnSanApiListRpnSansRequest = { /** * Page number. @@ -3070,7 +2834,6 @@ export type RpnSanApiListRpnSansRequest = { projectId?: string } - export type RpnSanApiRemoveIpRequest = { /** * RPN SAN ID. @@ -3082,7 +2845,6 @@ export type RpnSanApiRemoveIpRequest = { ipIds: number[] } - export type RpnV1ApiAcceptRpnInviteRequest = { /** * The member ID. @@ -3090,7 +2852,6 @@ export type RpnV1ApiAcceptRpnInviteRequest = { memberId: number } - export type RpnV1ApiAddRpnGroupMembersRequest = { /** * The rpn v1 group ID. @@ -3106,7 +2867,6 @@ export type RpnV1ApiAddRpnGroupMembersRequest = { sanServerIds?: number[] } - export type RpnV1ApiCreateRpnGroupRequest = { /** * Rpn v1 group name. @@ -3126,7 +2886,6 @@ export type RpnV1ApiCreateRpnGroupRequest = { projectId?: string } - export type RpnV1ApiDeleteRpnGroupMembersRequest = { /** * The rpn v1 group ID. @@ -3138,7 +2897,6 @@ export type RpnV1ApiDeleteRpnGroupMembersRequest = { memberIds: number[] } - export type RpnV1ApiDeleteRpnGroupRequest = { /** * Rpn v1 group ID. @@ -3146,7 +2904,6 @@ export type RpnV1ApiDeleteRpnGroupRequest = { groupId: number } - export type RpnV1ApiGetRpnGroupRequest = { /** * Rpn v1 group ID. @@ -3154,7 +2911,6 @@ export type RpnV1ApiGetRpnGroupRequest = { groupId: number } - export type RpnV1ApiLeaveRpnGroupRequest = { /** * The RPN V1 group ID. @@ -3166,7 +2922,6 @@ export type RpnV1ApiLeaveRpnGroupRequest = { memberIds: number[] } - export type RpnV1ApiListRpnCapableSanServersRequest = { /** * Page number. @@ -3186,7 +2941,6 @@ export type RpnV1ApiListRpnCapableSanServersRequest = { projectId?: string } - export type RpnV1ApiListRpnCapableServersRequest = { /** * Page number. @@ -3206,7 +2960,6 @@ export type RpnV1ApiListRpnCapableServersRequest = { projectId?: string } - export type RpnV1ApiListRpnGroupMembersRequest = { /** * Filter rpn v1 group members by group ID. @@ -3230,7 +2983,6 @@ export type RpnV1ApiListRpnGroupMembersRequest = { projectId?: string } - export type RpnV1ApiListRpnGroupsRequest = { /** * Page number. @@ -3250,7 +3002,6 @@ export type RpnV1ApiListRpnGroupsRequest = { projectId?: string } - export type RpnV1ApiListRpnInvitesRequest = { /** * Page number. @@ -3270,7 +3021,6 @@ export type RpnV1ApiListRpnInvitesRequest = { projectId?: string } - export type RpnV1ApiRefuseRpnInviteRequest = { /** * The member ID. @@ -3278,7 +3028,6 @@ export type RpnV1ApiRefuseRpnInviteRequest = { memberId: number } - export type RpnV1ApiRpnGroupInviteRequest = { /** * The RPN V1 group ID. @@ -3294,7 +3043,6 @@ export type RpnV1ApiRpnGroupInviteRequest = { projectId?: string } - export type RpnV1ApiUpdateRpnGroupNameRequest = { /** * Rpn v1 group ID. @@ -3306,7 +3054,6 @@ export type RpnV1ApiUpdateRpnGroupNameRequest = { name?: string } - export type RpnV2ApiAddRpnV2MembersRequest = { /** * RPN V2 group ID. @@ -3318,7 +3065,6 @@ export type RpnV2ApiAddRpnV2MembersRequest = { servers: number[] } - export type RpnV2ApiCreateRpnV2GroupRequest = { /** * Project ID of the RPN V2 group. @@ -3338,7 +3084,6 @@ export type RpnV2ApiCreateRpnV2GroupRequest = { servers: number[] } - export type RpnV2ApiDeleteRpnV2GroupRequest = { /** * RPN V2 group ID. @@ -3346,7 +3091,6 @@ export type RpnV2ApiDeleteRpnV2GroupRequest = { groupId: number } - export type RpnV2ApiDeleteRpnV2MembersRequest = { /** * RPN V2 group ID. @@ -3358,7 +3102,6 @@ export type RpnV2ApiDeleteRpnV2MembersRequest = { memberIds: number[] } - export type RpnV2ApiDisableRpnV2GroupCompatibilityRequest = { /** * RPN V2 group ID. @@ -3366,7 +3109,6 @@ export type RpnV2ApiDisableRpnV2GroupCompatibilityRequest = { groupId: number } - export type RpnV2ApiEnableRpnV2GroupCompatibilityRequest = { /** * RPN V2 group ID. @@ -3378,7 +3120,6 @@ export type RpnV2ApiEnableRpnV2GroupCompatibilityRequest = { rpnv1GroupId: number } - export type RpnV2ApiGetRpnV2GroupRequest = { /** * RPN V2 group ID. @@ -3386,7 +3127,6 @@ export type RpnV2ApiGetRpnV2GroupRequest = { groupId: number } - export type RpnV2ApiListRpnV2CapableResourcesRequest = { /** * Page number. @@ -3406,7 +3146,6 @@ export type RpnV2ApiListRpnV2CapableResourcesRequest = { projectId?: string } - export type RpnV2ApiListRpnV2GroupLogsRequest = { /** * RPN V2 group ID. @@ -3426,7 +3165,6 @@ export type RpnV2ApiListRpnV2GroupLogsRequest = { orderBy?: ListRpnV2GroupLogsRequestOrderBy } - export type RpnV2ApiListRpnV2GroupsRequest = { /** * Page number. @@ -3446,7 +3184,6 @@ export type RpnV2ApiListRpnV2GroupsRequest = { projectId?: string } - export type RpnV2ApiListRpnV2MembersRequest = { /** * RPN V2 group ID. @@ -3470,7 +3207,6 @@ export type RpnV2ApiListRpnV2MembersRequest = { type?: ListRpnV2MembersRequestType } - export type RpnV2ApiUpdateRpnV2GroupNameRequest = { /** * RPN V2 group ID. @@ -3482,7 +3218,6 @@ export type RpnV2ApiUpdateRpnV2GroupNameRequest = { name?: string } - export type RpnV2ApiUpdateRpnV2VlanForMembersRequest = { /** * RPN V2 group ID. @@ -3499,7 +3234,6 @@ Max: 3967. vlan?: number } - export interface ServerDefaultPartitioning { /** * Default partitions. @@ -3507,7 +3241,6 @@ export interface ServerDefaultPartitioning { partitions: Partition[] } - export interface ServerInstall { osId: number hostname: string @@ -3518,7 +3251,6 @@ export interface ServerInstall { panelUrl?: string } - export type StartBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3534,7 +3266,6 @@ export type StartBMCAccessRequest = { ip: string } - export type StartRescueRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3550,7 +3281,6 @@ export type StartRescueRequest = { osId: number } - export type StartServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3562,7 +3292,6 @@ export type StartServerRequest = { serverId: number } - export type StopBMCAccessRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3574,7 +3303,6 @@ export type StopBMCAccessRequest = { serverId: number } - export type StopRescueRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3586,7 +3314,6 @@ export type StopRescueRequest = { serverId: number } - export type StopServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3598,7 +3325,6 @@ export type StopServerRequest = { serverId: number } - export type SubscribeServerOptionRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3614,7 +3340,6 @@ export type SubscribeServerOptionRequest = { optionId: number } - export type SubscribeStorageOptionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3630,7 +3355,6 @@ export type SubscribeStorageOptionsRequest = { optionsIds: number[] } - export interface SubscribeStorageOptionsResponse { /** * Services subscribe storage options. @@ -3638,7 +3362,6 @@ export interface SubscribeStorageOptionsResponse { services: Service[] } - export type UpdateRaidRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3654,7 +3377,6 @@ export type UpdateRaidRequest = { raidArrays: UpdatableRaidArray[] } - export type UpdateReverseRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3670,7 +3392,6 @@ export type UpdateReverseRequest = { reverse: string } - export type UpdateServerBackupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3694,7 +3415,6 @@ export type UpdateServerBackupRequest = { aclEnabled?: boolean } - export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3714,7 +3434,6 @@ export type UpdateServerRequest = { enableIpv6?: boolean } - export type UpdateServerTagsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3729,5 +3448,3 @@ export type UpdateServerTagsRequest = { */ tags?: string[] } - - diff --git a/packages_generated/domain/src/v2beta1/api.gen.ts b/packages_generated/domain/src/v2beta1/api.gen.ts index 583cabc3a..5c7f5237d 100644 --- a/packages_generated/domain/src/v2beta1/api.gen.ts +++ b/packages_generated/domain/src/v2beta1/api.gen.ts @@ -3,13 +3,15 @@ import { API as ParentAPI, enrichForPagination, - unmarshalServiceInfo, urlParams, validatePathParam, waitForResource, } from '@scaleway/sdk-client' -import type { ServiceInfo, WaitForOptions, } from '@scaleway/sdk-client' -import {DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_DOMAIN,SSL_CERTIFICATE_TRANSIENT_STATUSES as SSL_CERTIFICATE_TRANSIENT_STATUSES_DOMAIN,} from './content.gen.js' +import type { WaitForOptions } from '@scaleway/sdk-client' +import { + DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_DOMAIN, + SSL_CERTIFICATE_TRANSIENT_STATUSES as SSL_CERTIFICATE_TRANSIENT_STATUSES_DOMAIN, +} from './content.gen.js' import { unmarshalCheckContactsCompatibilityResponse, unmarshalClearDNSZoneRecordsResponse, @@ -62,7 +64,6 @@ import { unmarshalRestoreDNSZoneVersionResponse, unmarshalRetryInboundTransferResponse, unmarshalSSLCertificate, - unmarshalSearchAvailableDomainsConsoleResponse, unmarshalSearchAvailableDomainsResponse, marshalUpdateDNSZoneNameserversRequest, unmarshalUpdateDNSZoneNameserversResponse, @@ -155,9 +156,7 @@ import type { RestoreDNSZoneVersionResponse, RetryInboundTransferResponse, SSLCertificate, - SearchAvailableDomainsConsoleResponse, SearchAvailableDomainsResponse, - UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest, UpdateDNSZoneNameserversRequest, UpdateDNSZoneNameserversResponse, UpdateDNSZoneRecordsRequest, @@ -189,7 +188,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['updated_after', request.updatedAfter], ['updated_before', request.updatedBefore], @@ -197,7 +199,7 @@ export class API extends ParentAPI { }, unmarshalListDNSZonesResponse, ) - + /** * List DNS zones. Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names. * @@ -207,7 +209,6 @@ export class API extends ParentAPI { listDNSZones = (request: Readonly) => enrichForPagination('dnsZones', this.pageOfListDNSZones, request) - /** * Create a DNS zone. Create a new DNS zone specified by the domain name, the subdomain and the Project ID. * @@ -227,7 +228,6 @@ export class API extends ParentAPI { unmarshalDNSZone, ) - /** * Update a DNS zone. Update the name and/or the Organizations for a DNS zone. * @@ -247,7 +247,6 @@ export class API extends ParentAPI { unmarshalDNSZone, ) - /** * Clone a DNS zone. Clone an existing DNS zone with all its records into a new DNS zone. * @@ -267,7 +266,6 @@ export class API extends ParentAPI { unmarshalDNSZone, ) - /** * Delete a DNS zone. Delete a DNS zone and all its records. * @@ -279,15 +277,17 @@ export class API extends ParentAPI { { method: 'DELETE', path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalDeleteDNSZoneResponse, ) - - protected pageOfListDNSZoneRecords = (request: Readonly) => + protected pageOfListDNSZoneRecords = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -297,14 +297,17 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['type', request.type], ), }, unmarshalListDNSZoneRecordsResponse, ) - + /** * List records within a DNS zone. Retrieve a list of DNS records within a DNS zone that has default name servers. You can filter records by type and name. @@ -315,7 +318,6 @@ You can filter records by type and name. listDNSZoneRecords = (request: Readonly) => enrichForPagination('records', this.pageOfListDNSZoneRecords, request) - /** * Update records within a DNS zone. Update records within a DNS zone that has default name servers and perform several actions on your records. @@ -343,7 +345,6 @@ All edits will be versioned. unmarshalUpdateDNSZoneRecordsResponse, ) - /** * List name servers within a DNS zone. Retrieve a list of name servers within a DNS zone and their optional glue records. * @@ -355,21 +356,20 @@ All edits will be versioned. { method: 'GET', path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/nameservers`, - urlParams: urlParams( - ['project_id', request.projectId], - ), + urlParams: urlParams(['project_id', request.projectId]), }, unmarshalListDNSZoneNameserversResponse, ) - /** * Update name servers within a DNS zone. Update name servers within a DNS zone and set optional glue records. * * @param request - The request {@link UpdateDNSZoneNameserversRequest} * @returns A Promise of UpdateDNSZoneNameserversResponse */ - updateDNSZoneNameservers = (request: Readonly) => + updateDNSZoneNameservers = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -382,7 +382,6 @@ All edits will be versioned. unmarshalUpdateDNSZoneNameserversResponse, ) - /** * Clear records within a DNS zone. Delete all records within a DNS zone that has default name servers.
All edits will be versioned. @@ -399,7 +398,6 @@ All edits will be versioned. unmarshalClearDNSZoneRecordsResponse, ) - /** * Export a raw DNS zone. Export a DNS zone with default name servers, in a specific format. * @@ -407,19 +405,13 @@ All edits will be versioned. * @returns A Promise of Blob */ exportRawDNSZone = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`, - urlParams: urlParams( - ['dl', 1], - ['format', request.format], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/raw`, + urlParams: urlParams(['dl', 1], ['format', request.format]), + responseType: 'blob', + }) - /** * Import a raw DNS zone. Import and replace the format of records from a given provider, with default name servers. * @@ -439,7 +431,6 @@ All edits will be versioned. unmarshalImportRawDNSZoneResponse, ) - /** * Import a DNS zone from another provider. Import and replace the format of records from a given provider, with default name servers. * @@ -459,7 +450,6 @@ All edits will be versioned. unmarshalImportProviderDNSZoneResponse, ) - /** * Refresh a DNS zone. Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial. You can recreate the given DNS zone and its sub DNS zone if needed. @@ -480,20 +470,24 @@ You can recreate the given DNS zone and its sub DNS zone if needed. unmarshalRefreshDNSZoneResponse, ) - - protected pageOfListDNSZoneVersions = (request: Readonly) => + protected pageOfListDNSZoneVersions = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDNSZoneVersionsResponse, ) - + /** * List versions of a DNS zone. Retrieve a list of a DNS zone's versions.
The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification. @@ -504,30 +498,39 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve listDNSZoneVersions = (request: Readonly) => enrichForPagination('versions', this.pageOfListDNSZoneVersions, request) - - protected pageOfListDNSZoneVersionRecords = (request: Readonly) => + protected pageOfListDNSZoneVersionRecords = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/domain/v2beta1/dns-zones/version/${validatePathParam('dnsZoneVersionId', request.dnsZoneVersionId)}`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDNSZoneVersionRecordsResponse, ) - + /** * List records from a given version of a specific DNS zone. Retrieve a list of records from a specific DNS zone version. * * @param request - The request {@link ListDNSZoneVersionRecordsRequest} * @returns A Promise of ListDNSZoneVersionRecordsResponse */ - listDNSZoneVersionRecords = (request: Readonly) => - enrichForPagination('records', this.pageOfListDNSZoneVersionRecords, request) + listDNSZoneVersionRecords = ( + request: Readonly, + ) => + enrichForPagination( + 'records', + this.pageOfListDNSZoneVersionRecords, + request, + ) - /** * Access differences from a specific DNS zone version. Access a previous DNS zone version to see the differences from another specific version. * @@ -543,7 +546,6 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve unmarshalGetDNSZoneVersionDiffResponse, ) - /** * Restore a DNS zone version. Restore and activate a version of a specific DNS zone. * @@ -561,7 +563,6 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve unmarshalRestoreDNSZoneVersionResponse, ) - /** * Get a DNS zone's TLS certificate. Get the DNS zone's TLS certificate. If you do not have a certificate, the output returns `no certificate found`. * @@ -576,7 +577,7 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve }, unmarshalSSLCertificate, ) - + /** * Waits for {@link SSLCertificate} to be in a final state. * @@ -589,13 +590,16 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SSL_CERTIFICATE_TRANSIENT_STATUSES_DOMAIN.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SSL_CERTIFICATE_TRANSIENT_STATUSES_DOMAIN.includes(res.status), + )), this.getSSLCertificate, request, options, ) - /** * Create or get the DNS zone's TLS certificate. Create a new TLS certificate or retrieve information about an existing TLS certificate. * @@ -615,8 +619,9 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve unmarshalSSLCertificate, ) - - protected pageOfListSSLCertificates = (request: Readonly) => + protected pageOfListSSLCertificates = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -624,13 +629,16 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve urlParams: urlParams( ['dns_zone', request.dnsZone], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSSLCertificatesResponse, ) - + /** * List a user's TLS certificates. List all the TLS certificates a user has created, specified by the user's Project ID and the DNS zone. * @@ -640,7 +648,6 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve listSSLCertificates = (request: Readonly) => enrichForPagination('certificates', this.pageOfListSSLCertificates, request) - /** * Delete a TLS certificate. Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone. * @@ -656,7 +663,6 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve unmarshalDeleteSSLCertificateResponse, ) - /** * Get the DNS zone's TSIG key. Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests. * @@ -672,21 +678,16 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve unmarshalGetDNSZoneTsigKeyResponse, ) - /** * Delete the DNS zone's TSIG key. Delete an existing TSIG key specified by its DNS zone. Deleting a TSIG key is permanent and cannot be undone. * * @param request - The request {@link DeleteDNSZoneTsigKeyRequest} */ deleteDNSZoneTsigKey = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/domain/v2beta1/dns-zones/${validatePathParam('dnsZone', request.dnsZone)}/tsig-key`, + }) } /** @@ -695,7 +696,9 @@ The maximum version count is 100. If the count reaches this limit, the oldest ve Manage your domains and contacts. */ export class RegistrarAPI extends ParentAPI { - protected pageOfListTasks = (request: Readonly = {}) => + protected pageOfListTasks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -705,7 +708,10 @@ export class RegistrarAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['statuses', request.statuses], ['types', request.types], @@ -713,7 +719,7 @@ export class RegistrarAPI extends ParentAPI { }, unmarshalListTasksResponse, ) - + /** * List tasks. List all operations performed on the account. You can filter the list of tasks by domain name. @@ -724,23 +730,34 @@ You can filter the list of tasks by domain name. listTasks = (request: Readonly = {}) => enrichForPagination('tasks', this.pageOfListTasks, request) - - protected pageOfListInboundTransfers = (request: Readonly) => + protected pageOfListInboundTransfers = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/domain/v2beta1/inbound-transfers`, urlParams: urlParams( ['domain', request.domain], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListInboundTransfersResponse, ) - + /** * List inbound domain transfers. List all inbound transfer operations on the account. You can filter the list of inbound transfers by domain name. @@ -748,21 +765,31 @@ You can filter the list of inbound transfers by domain name. * @param request - The request {@link RegistrarApiListInboundTransfersRequest} * @returns A Promise of ListInboundTransfersResponse */ - listInboundTransfers = (request: Readonly) => - enrichForPagination('inboundTransfers', this.pageOfListInboundTransfers, request) + listInboundTransfers = ( + request: Readonly, + ) => + enrichForPagination( + 'inboundTransfers', + this.pageOfListInboundTransfers, + request, + ) - /** * Retry the inbound transfer of a domain. Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS. * * @param request - The request {@link RegistrarApiRetryInboundTransferRequest} * @returns A Promise of RetryInboundTransferResponse */ - retryInboundTransfer = (request: Readonly) => + retryInboundTransfer = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiRetryInboundTransferRequest(request, this.client.settings), + marshalRegistrarApiRetryInboundTransferRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -771,7 +798,6 @@ You can filter the list of inbound transfers by domain name. unmarshalRetryInboundTransferResponse, ) - /** * Purchase domains. Request the registration of domain names. You can provide a domain's already existing contact or a new contact. @@ -792,7 +818,6 @@ You can provide a domain's already existing contact or a new contact. unmarshalOrderResponse, ) - /** * Renew domains. Request the renewal of one or more domain names. * @@ -812,7 +837,6 @@ You can provide a domain's already existing contact or a new contact. unmarshalOrderResponse, ) - /** * Transfer a domain. Request the transfer of a domain from another registrar to Scaleway Domains and DNS. * @@ -823,7 +847,10 @@ You can provide a domain's already existing contact or a new contact. this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiTransferInDomainRequest(request, this.client.settings), + marshalRegistrarApiTransferInDomainRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -832,7 +859,6 @@ You can provide a domain's already existing contact or a new contact. unmarshalOrderResponse, ) - /** * Trade a domain's contact. Request to change a domain's contact owner.
If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.
@@ -855,18 +881,22 @@ If the new owner has never created a contact to register domains before, an erro unmarshalOrderResponse, ) - /** * Register an external domain. Request the registration of an external domain name. * * @param request - The request {@link RegistrarApiRegisterExternalDomainRequest} * @returns A Promise of RegisterExternalDomainResponse */ - registerExternalDomain = (request: Readonly) => + registerExternalDomain = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiRegisterExternalDomainRequest(request, this.client.settings), + marshalRegistrarApiRegisterExternalDomainRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -875,14 +905,15 @@ If the new owner has never created a contact to register domains before, an erro unmarshalRegisterExternalDomainResponse, ) - /** * Delete an external domain. Delete an external domain name. * * @param request - The request {@link RegistrarApiDeleteExternalDomainRequest} * @returns A Promise of DeleteExternalDomainResponse */ - deleteExternalDomain = (request: Readonly) => + deleteExternalDomain = ( + request: Readonly, + ) => this.client.fetch( { method: 'DELETE', @@ -891,7 +922,6 @@ If the new owner has never created a contact to register domains before, an erro unmarshalDeleteExternalDomainResponse, ) - /** * Check if contacts are compatible with a domain or a TLD. Check whether contacts are compatible with a domain or a TLD. If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned. @@ -899,11 +929,16 @@ If contacts are not compatible with either the domain or the TLD, the informatio * @param request - The request {@link RegistrarApiCheckContactsCompatibilityRequest} * @returns A Promise of CheckContactsCompatibilityResponse */ - checkContactsCompatibility = (request: Readonly = {}) => + checkContactsCompatibility = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiCheckContactsCompatibilityRequest(request, this.client.settings), + marshalRegistrarApiCheckContactsCompatibilityRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -912,8 +947,9 @@ If contacts are not compatible with either the domain or the TLD, the informatio unmarshalCheckContactsCompatibilityResponse, ) - - protected pageOfListContacts = (request: Readonly = {}) => + protected pageOfListContacts = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -923,14 +959,17 @@ If contacts are not compatible with either the domain or the TLD, the informatio ['email_status', request.emailStatus], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['role', request.role], ), }, unmarshalListContactsResponse, ) - + /** * List contacts. Retrieve the list of contacts and their associated domains and roles. You can filter the list by domain name. @@ -941,7 +980,6 @@ You can filter the list by domain name. listContacts = (request: Readonly = {}) => enrichForPagination('contacts', this.pageOfListContacts, request) - /** * Get a contact. Retrieve a contact's details from the registrar using the given contact's ID. * @@ -957,7 +995,6 @@ You can filter the list by domain name. unmarshalContact, ) - /** * Update contact. Edit the contact's information. * @@ -968,7 +1005,10 @@ You can filter the list by domain name. this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiUpdateContactRequest(request, this.client.settings), + marshalRegistrarApiUpdateContactRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -977,8 +1017,9 @@ You can filter the list by domain name. unmarshalContact, ) - - protected pageOfListDomains = (request: Readonly = {}) => + protected pageOfListDomains = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -989,7 +1030,10 @@ You can filter the list by domain name. ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['registrar', request.registrar], ['status', request.status], @@ -997,7 +1041,7 @@ You can filter the list by domain name. }, unmarshalListDomainsResponse, ) - + /** * List domains. Retrieve the list of domains you own. * @@ -1007,8 +1051,9 @@ You can filter the list by domain name. listDomains = (request: Readonly = {}) => enrichForPagination('domains', this.pageOfListDomains, request) - - protected pageOfListRenewableDomains = (request: Readonly = {}) => + protected pageOfListRenewableDomains = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1017,23 +1062,26 @@ You can filter the list by domain name. ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRenewableDomainsResponse, ) - + /** * List domains that can be renewed. Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable. * * @param request - The request {@link RegistrarApiListRenewableDomainsRequest} * @returns A Promise of ListRenewableDomainsResponse */ - listRenewableDomains = (request: Readonly = {}) => - enrichForPagination('domains', this.pageOfListRenewableDomains, request) + listRenewableDomains = ( + request: Readonly = {}, + ) => enrichForPagination('domains', this.pageOfListRenewableDomains, request) - /** * Get domain. Retrieve a specific domain and display the domain's information. * @@ -1048,7 +1096,7 @@ You can filter the list by domain name. }, unmarshalDomain, ) - + /** * Waits for {@link Domain} to be in a final state. * @@ -1061,13 +1109,16 @@ You can filter the list by domain name. options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_DOMAIN.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DOMAIN_TRANSIENT_STATUSES_DOMAIN.includes(res.status), + )), this.getDomain, request, options, ) - /** * Update a domain's contacts. Update contacts for a specific domain or create a new contact.
If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles. @@ -1088,14 +1139,15 @@ If you add the same contact for multiple roles (owner, administrative, technical unmarshalDomain, ) - /** * Lock the transfer of a domain. Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar. * * @param request - The request {@link RegistrarApiLockDomainTransferRequest} * @returns A Promise of Domain */ - lockDomainTransfer = (request: Readonly) => + lockDomainTransfer = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1106,14 +1158,15 @@ If you add the same contact for multiple roles (owner, administrative, technical unmarshalDomain, ) - /** * Unlock the transfer of a domain. Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar. * * @param request - The request {@link RegistrarApiUnlockDomainTransferRequest} * @returns A Promise of Domain */ - unlockDomainTransfer = (request: Readonly) => + unlockDomainTransfer = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1124,14 +1177,15 @@ If you add the same contact for multiple roles (owner, administrative, technical unmarshalDomain, ) - /** * Enable auto renew. Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date. * * @param request - The request {@link RegistrarApiEnableDomainAutoRenewRequest} * @returns A Promise of Domain */ - enableDomainAutoRenew = (request: Readonly) => + enableDomainAutoRenew = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1142,14 +1196,15 @@ If you add the same contact for multiple roles (owner, administrative, technical unmarshalDomain, ) - /** * Disable auto renew. Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date. * * @param request - The request {@link RegistrarApiDisableDomainAutoRenewRequest} * @returns A Promise of Domain */ - disableDomainAutoRenew = (request: Readonly) => + disableDomainAutoRenew = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1160,7 +1215,6 @@ If you add the same contact for multiple roles (owner, administrative, technical unmarshalDomain, ) - /** * Get a domain's authorization code. Retrieve the authorization code to transfer an unlocked domain. The output returns an error if the domain is locked. Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field. @@ -1168,7 +1222,9 @@ Some TLDs may have a different procedure to retrieve the authorization code. In * @param request - The request {@link RegistrarApiGetDomainAuthCodeRequest} * @returns A Promise of GetDomainAuthCodeResponse */ - getDomainAuthCode = (request: Readonly) => + getDomainAuthCode = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1177,18 +1233,22 @@ Some TLDs may have a different procedure to retrieve the authorization code. In unmarshalGetDomainAuthCodeResponse, ) - /** * Update domain DNSSEC. If your domain uses another registrar and has the default Scaleway NS, you have to **update the DS record at your registrar**. * * @param request - The request {@link RegistrarApiEnableDomainDNSSECRequest} * @returns A Promise of Domain */ - enableDomainDNSSEC = (request: Readonly) => + enableDomainDNSSEC = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiEnableDomainDNSSECRequest(request, this.client.settings), + marshalRegistrarApiEnableDomainDNSSECRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1197,14 +1257,15 @@ Some TLDs may have a different procedure to retrieve the authorization code. In unmarshalDomain, ) - /** * Disable a domain's DNSSEC. Disable DNSSEC for a domain. * * @param request - The request {@link RegistrarApiDisableDomainDNSSECRequest} * @returns A Promise of Domain */ - disableDomainDNSSEC = (request: Readonly) => + disableDomainDNSSEC = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1215,7 +1276,6 @@ Some TLDs may have a different procedure to retrieve the authorization code. In unmarshalDomain, ) - /** * Search available domains. Search a domain or a maximum of 10 domains that are available. @@ -1224,7 +1284,9 @@ If the TLD list is empty or not set, the search returns the results from the mos * @param request - The request {@link RegistrarApiSearchAvailableDomainsRequest} * @returns A Promise of SearchAvailableDomainsResponse */ - searchAvailableDomains = (request: Readonly) => + searchAvailableDomains = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1238,8 +1300,9 @@ If the TLD list is empty or not set, the search returns the results from the mos unmarshalSearchAvailableDomainsResponse, ) - - protected pageOfListTlds = (request: Readonly = {}) => + protected pageOfListTlds = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1247,13 +1310,16 @@ If the TLD list is empty or not set, the search returns the results from the mos urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['tlds', request.tlds], ), }, unmarshalListTldsResponse, ) - + /** * List TLD offers. Retrieve the list of TLDs and offers associated with them. * @@ -1263,7 +1329,6 @@ If the TLD list is empty or not set, the search returns the results from the mos listTlds = (request: Readonly = {}) => enrichForPagination('tlds', this.pageOfListTlds, request) - /** * Create a hostname for a domain. Create a hostname for a domain with glue IPs. * @@ -1274,7 +1339,10 @@ If the TLD list is empty or not set, the search returns the results from the mos this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiCreateDomainHostRequest(request, this.client.settings), + marshalRegistrarApiCreateDomainHostRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1283,20 +1351,24 @@ If the TLD list is empty or not set, the search returns the results from the mos unmarshalHost, ) - - protected pageOfListDomainHosts = (request: Readonly) => + protected pageOfListDomainHosts = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/domain/v2beta1/domains/${validatePathParam('domain', request.domain)}/hosts`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDomainHostsResponse, ) - + /** * List a domain's hostnames. List a domain's hostnames using their glue IPs. * @@ -1306,7 +1378,6 @@ If the TLD list is empty or not set, the search returns the results from the mos listDomainHosts = (request: Readonly) => enrichForPagination('hosts', this.pageOfListDomainHosts, request) - /** * Update a domain's hostname. Update a domain's hostname with glue IPs. * @@ -1317,7 +1388,10 @@ If the TLD list is empty or not set, the search returns the results from the mos this.client.fetch( { body: JSON.stringify( - marshalRegistrarApiUpdateDomainHostRequest(request, this.client.settings), + marshalRegistrarApiUpdateDomainHostRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1326,7 +1400,6 @@ If the TLD list is empty or not set, the search returns the results from the mos unmarshalHost, ) - /** * Delete a domain's hostname. * @@ -1341,38 +1414,4 @@ If the TLD list is empty or not set, the search returns the results from the mos }, unmarshalHost, ) - - } - -/** - * Unauthenticated Domain search API. - */ -export class UnauthenticatedRegistrarAPI extends ParentAPI { - getServiceInfo = () => - this.client.fetch( - { - method: 'GET', - path: `/domain/v2beta1/search`, - }, - unmarshalServiceInfo, - ) - - - searchAvailableDomainsConsole = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/domain/v2beta1/search-domains-console`, - urlParams: urlParams( - ['domain', request.domain], - ['strict_search', request.strictSearch], - ['tlds', request.tlds], - ), - }, - unmarshalSearchAvailableDomainsConsoleResponse, - ) - - -} - diff --git a/packages_generated/domain/src/v2beta1/content.gen.ts b/packages_generated/domain/src/v2beta1/content.gen.ts index 390fe04ec..6e0b5a6f6 100644 --- a/packages_generated/domain/src/v2beta1/content.gen.ts +++ b/packages_generated/domain/src/v2beta1/content.gen.ts @@ -10,11 +10,8 @@ import type { TaskStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link DNSZoneStatus}. */ -export const DNS_ZONE_TRANSIENT_STATUSES: DNSZoneStatus[] = [ - 'pending', -] +export const DNS_ZONE_TRANSIENT_STATUSES: DNSZoneStatus[] = ['pending'] /** Lists transient statutes of the enum {@link DomainFeatureStatus}. */ export const DOMAIN_FEATURE_TRANSIENT_STATUSES: DomainFeatureStatus[] = [ @@ -23,10 +20,8 @@ export const DOMAIN_FEATURE_TRANSIENT_STATUSES: DomainFeatureStatus[] = [ ] /** Lists transient statutes of the enum {@link DomainRegistrationStatusTransferStatus}. */ -export const DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES: DomainRegistrationStatusTransferStatus[] = [ - 'pending', - 'processing', -] +export const DOMAIN_REGISTRATION_STATUS_TRANSFER_TRANSIENT_STATUSES: DomainRegistrationStatusTransferStatus[] = + ['pending', 'processing'] /** Lists transient statutes of the enum {@link DomainStatus}. */ export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = [ @@ -40,10 +35,7 @@ export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = [ ] /** Lists transient statutes of the enum {@link HostStatus}. */ -export const HOST_TRANSIENT_STATUSES: HostStatus[] = [ - 'updating', - 'deleting', -] +export const HOST_TRANSIENT_STATUSES: HostStatus[] = ['updating', 'deleting'] /** Lists transient statutes of the enum {@link SSLCertificateStatus}. */ export const SSL_CERTIFICATE_TRANSIENT_STATUSES: SSLCertificateStatus[] = [ @@ -51,7 +43,4 @@ export const SSL_CERTIFICATE_TRANSIENT_STATUSES: SSLCertificateStatus[] = [ ] /** Lists transient statutes of the enum {@link TaskStatus}. */ -export const TASK_TRANSIENT_STATUSES: TaskStatus[] = [ - 'pending', -] - +export const TASK_TRANSIENT_STATUSES: TaskStatus[] = ['pending'] diff --git a/packages_generated/domain/src/v2beta1/marshalling.gen.ts b/packages_generated/domain/src/v2beta1/marshalling.gen.ts index bef1b4c76..2b377eba3 100644 --- a/packages_generated/domain/src/v2beta1/marshalling.gen.ts +++ b/packages_generated/domain/src/v2beta1/marshalling.gen.ts @@ -1,5 +1,11 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMapOfObject, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ContactExtensionFRAssociationInfo, @@ -9,7 +15,6 @@ import type { ContactExtensionFRTrademarkInfo, ContactExtensionEU, ContactExtensionFR, - ContactExtensionIT, ContactExtensionNL, ContactQuestion, Contact, @@ -77,7 +82,6 @@ import type { RestoreDNSZoneVersionResponse, RetryInboundTransferResponse, AvailableDomain, - SearchAvailableDomainsConsoleResponse, SearchAvailableDomainsResponse, UpdateDNSZoneNameserversResponse, UpdateDNSZoneRecordsResponse, @@ -111,7 +115,9 @@ import type { UpdateDNSZoneRequest, } from './types.gen.js' -const unmarshalContactExtensionFRAssociationInfo = (data: unknown): ContactExtensionFRAssociationInfo => { +const unmarshalContactExtensionFRAssociationInfo = ( + data: unknown, +): ContactExtensionFRAssociationInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContactExtensionFRAssociationInfo' failed as data isn't a dictionary.`, @@ -124,7 +130,9 @@ const unmarshalContactExtensionFRAssociationInfo = (data: unknown): ContactExten } as ContactExtensionFRAssociationInfo } -const unmarshalContactExtensionFRCodeAuthAfnicInfo = (data: unknown): ContactExtensionFRCodeAuthAfnicInfo => { +const unmarshalContactExtensionFRCodeAuthAfnicInfo = ( + data: unknown, +): ContactExtensionFRCodeAuthAfnicInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContactExtensionFRCodeAuthAfnicInfo' failed as data isn't a dictionary.`, @@ -136,7 +144,9 @@ const unmarshalContactExtensionFRCodeAuthAfnicInfo = (data: unknown): ContactExt } as ContactExtensionFRCodeAuthAfnicInfo } -const unmarshalContactExtensionFRDunsInfo = (data: unknown): ContactExtensionFRDunsInfo => { +const unmarshalContactExtensionFRDunsInfo = ( + data: unknown, +): ContactExtensionFRDunsInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContactExtensionFRDunsInfo' failed as data isn't a dictionary.`, @@ -149,7 +159,9 @@ const unmarshalContactExtensionFRDunsInfo = (data: unknown): ContactExtensionFRD } as ContactExtensionFRDunsInfo } -const unmarshalContactExtensionFRIndividualInfo = (data: unknown): ContactExtensionFRIndividualInfo => { +const unmarshalContactExtensionFRIndividualInfo = ( + data: unknown, +): ContactExtensionFRIndividualInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContactExtensionFRIndividualInfo' failed as data isn't a dictionary.`, @@ -161,7 +173,9 @@ const unmarshalContactExtensionFRIndividualInfo = (data: unknown): ContactExtens } as ContactExtensionFRIndividualInfo } -const unmarshalContactExtensionFRTrademarkInfo = (data: unknown): ContactExtensionFRTrademarkInfo => { +const unmarshalContactExtensionFRTrademarkInfo = ( + data: unknown, +): ContactExtensionFRTrademarkInfo => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ContactExtensionFRTrademarkInfo' failed as data isn't a dictionary.`, @@ -193,28 +207,25 @@ const unmarshalContactExtensionFR = (data: unknown): ContactExtensionFR => { } return { - associationInfo: data.association_info ? unmarshalContactExtensionFRAssociationInfo(data.association_info) : undefined, - codeAuthAfnicInfo: data.code_auth_afnic_info ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) : undefined, - dunsInfo: data.duns_info ? unmarshalContactExtensionFRDunsInfo(data.duns_info) : undefined, - individualInfo: data.individual_info ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) : undefined, + associationInfo: data.association_info + ? unmarshalContactExtensionFRAssociationInfo(data.association_info) + : undefined, + codeAuthAfnicInfo: data.code_auth_afnic_info + ? unmarshalContactExtensionFRCodeAuthAfnicInfo(data.code_auth_afnic_info) + : undefined, + dunsInfo: data.duns_info + ? unmarshalContactExtensionFRDunsInfo(data.duns_info) + : undefined, + individualInfo: data.individual_info + ? unmarshalContactExtensionFRIndividualInfo(data.individual_info) + : undefined, mode: data.mode, - trademarkInfo: data.trademark_info ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) : undefined, + trademarkInfo: data.trademark_info + ? unmarshalContactExtensionFRTrademarkInfo(data.trademark_info) + : undefined, } as ContactExtensionFR } -const unmarshalContactExtensionIT = (data: unknown): ContactExtensionIT => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'ContactExtensionIT' failed as data isn't a dictionary.`, - ) - } - - return { - europeanCitizenship: data.european_citizenship, - taxCode: data.tax_code, - } as ContactExtensionIT -} - const unmarshalContactExtensionNL = (data: unknown): ContactExtensionNL => { if (!isJSONObject(data)) { throw new TypeError( @@ -258,10 +269,15 @@ export const unmarshalContact = (data: unknown): Contact => { email: data.email, emailAlt: data.email_alt, emailStatus: data.email_status, - extensionEu: data.extension_eu ? unmarshalContactExtensionEU(data.extension_eu) : undefined, - extensionFr: data.extension_fr ? unmarshalContactExtensionFR(data.extension_fr) : undefined, - extensionIt: data.extension_it ? unmarshalContactExtensionIT(data.extension_it) : undefined, - extensionNl: data.extension_nl ? unmarshalContactExtensionNL(data.extension_nl) : undefined, + extensionEu: data.extension_eu + ? unmarshalContactExtensionEU(data.extension_eu) + : undefined, + extensionFr: data.extension_fr + ? unmarshalContactExtensionFR(data.extension_fr) + : undefined, + extensionNl: data.extension_nl + ? unmarshalContactExtensionNL(data.extension_nl) + : undefined, faxNumber: data.fax_number, firstname: data.firstname, id: data.id, @@ -269,7 +285,9 @@ export const unmarshalContact = (data: unknown): Contact => { lastname: data.lastname, legalForm: data.legal_form, phoneNumber: data.phone_number, - questions: data.questions ? unmarshalArrayOfObject(data.questions, unmarshalContactQuestion) : undefined, + questions: data.questions + ? unmarshalArrayOfObject(data.questions, unmarshalContactQuestion) + : undefined, resale: data.resale, state: data.state, status: data.status, @@ -333,7 +351,9 @@ export const unmarshalSSLCertificate = (data: unknown): SSLCertificate => { } as SSLCertificate } -const unmarshalCheckContactsCompatibilityResponseContactCheckResult = (data: unknown): CheckContactsCompatibilityResponseContactCheckResult => { +const unmarshalCheckContactsCompatibilityResponseContactCheckResult = ( + data: unknown, +): CheckContactsCompatibilityResponseContactCheckResult => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckContactsCompatibilityResponseContactCheckResult' failed as data isn't a dictionary.`, @@ -346,7 +366,9 @@ const unmarshalCheckContactsCompatibilityResponseContactCheckResult = (data: unk } as CheckContactsCompatibilityResponseContactCheckResult } -export const unmarshalCheckContactsCompatibilityResponse = (data: unknown): CheckContactsCompatibilityResponse => { +export const unmarshalCheckContactsCompatibilityResponse = ( + data: unknown, +): CheckContactsCompatibilityResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckContactsCompatibilityResponse' failed as data isn't a dictionary.`, @@ -354,55 +376,71 @@ export const unmarshalCheckContactsCompatibilityResponse = (data: unknown): Chec } return { - administrativeCheckResult: data.administrative_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.administrative_check_result) : undefined, + administrativeCheckResult: data.administrative_check_result + ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.administrative_check_result, + ) + : undefined, compatible: data.compatible, - ownerCheckResult: data.owner_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.owner_check_result) : undefined, - technicalCheckResult: data.technical_check_result ? unmarshalCheckContactsCompatibilityResponseContactCheckResult(data.technical_check_result) : undefined, + ownerCheckResult: data.owner_check_result + ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.owner_check_result, + ) + : undefined, + technicalCheckResult: data.technical_check_result + ? unmarshalCheckContactsCompatibilityResponseContactCheckResult( + data.technical_check_result, + ) + : undefined, } as CheckContactsCompatibilityResponse } -export const unmarshalClearDNSZoneRecordsResponse = (data: unknown): ClearDNSZoneRecordsResponse => { +export const unmarshalClearDNSZoneRecordsResponse = ( + data: unknown, +): ClearDNSZoneRecordsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ClearDNSZoneRecordsResponse' failed as data isn't a dictionary.`, ) } - return { - } as ClearDNSZoneRecordsResponse + return {} as ClearDNSZoneRecordsResponse } -export const unmarshalDeleteDNSZoneResponse = (data: unknown): DeleteDNSZoneResponse => { +export const unmarshalDeleteDNSZoneResponse = ( + data: unknown, +): DeleteDNSZoneResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteDNSZoneResponse' failed as data isn't a dictionary.`, ) } - return { - } as DeleteDNSZoneResponse + return {} as DeleteDNSZoneResponse } -export const unmarshalDeleteExternalDomainResponse = (data: unknown): DeleteExternalDomainResponse => { +export const unmarshalDeleteExternalDomainResponse = ( + data: unknown, +): DeleteExternalDomainResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteExternalDomainResponse' failed as data isn't a dictionary.`, ) } - return { - } as DeleteExternalDomainResponse + return {} as DeleteExternalDomainResponse } -export const unmarshalDeleteSSLCertificateResponse = (data: unknown): DeleteSSLCertificateResponse => { +export const unmarshalDeleteSSLCertificateResponse = ( + data: unknown, +): DeleteSSLCertificateResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteSSLCertificateResponse' failed as data isn't a dictionary.`, ) } - return { - } as DeleteSSLCertificateResponse + return {} as DeleteSSLCertificateResponse } const unmarshalDSRecordPublicKey = (data: unknown): DSRecordPublicKey => { @@ -426,7 +464,9 @@ const unmarshalDSRecordDigest = (data: unknown): DSRecordDigest => { return { digest: data.digest, - publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined, + publicKey: data.public_key + ? unmarshalDSRecordPublicKey(data.public_key) + : undefined, type: data.type, } as DSRecordDigest } @@ -442,7 +482,9 @@ export const unmarshalDSRecord = (data: unknown): DSRecord => { algorithm: data.algorithm, digest: data.digest ? unmarshalDSRecordDigest(data.digest) : undefined, keyId: data.key_id, - publicKey: data.public_key ? unmarshalDSRecordPublicKey(data.public_key) : undefined, + publicKey: data.public_key + ? unmarshalDSRecordPublicKey(data.public_key) + : undefined, } as DSRecord } @@ -473,7 +515,9 @@ const unmarshalDomainDNSSEC = (data: unknown): DomainDNSSEC => { } as DomainDNSSEC } -const unmarshalDomainRegistrationStatusExternalDomain = (data: unknown): DomainRegistrationStatusExternalDomain => { +const unmarshalDomainRegistrationStatusExternalDomain = ( + data: unknown, +): DomainRegistrationStatusExternalDomain => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRegistrationStatusExternalDomain' failed as data isn't a dictionary.`, @@ -485,7 +529,9 @@ const unmarshalDomainRegistrationStatusExternalDomain = (data: unknown): DomainR } as DomainRegistrationStatusExternalDomain } -const unmarshalDomainRegistrationStatusTransfer = (data: unknown): DomainRegistrationStatusTransfer => { +const unmarshalDomainRegistrationStatusTransfer = ( + data: unknown, +): DomainRegistrationStatusTransfer => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRegistrationStatusTransfer' failed as data isn't a dictionary.`, @@ -525,30 +571,46 @@ export const unmarshalDomain = (data: unknown): Domain => { } return { - administrativeContact: data.administrative_contact ? unmarshalContact(data.administrative_contact) : undefined, + administrativeContact: data.administrative_contact + ? unmarshalContact(data.administrative_contact) + : undefined, autoRenewStatus: data.auto_renew_status, dnsZones: unmarshalArrayOfObject(data.dns_zones, unmarshalDNSZone), dnssec: data.dnssec ? unmarshalDomainDNSSEC(data.dnssec) : undefined, domain: data.domain, eppCode: data.epp_code, expiredAt: unmarshalDate(data.expired_at), - externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined, + externalDomainRegistrationStatus: data.external_domain_registration_status + ? unmarshalDomainRegistrationStatusExternalDomain( + data.external_domain_registration_status, + ) + : undefined, isExternal: data.is_external, linkedProducts: data.linked_products, organizationId: data.organization_id, - ownerContact: data.owner_contact ? unmarshalContact(data.owner_contact) : undefined, + ownerContact: data.owner_contact + ? unmarshalContact(data.owner_contact) + : undefined, pendingTrade: data.pending_trade, projectId: data.project_id, registrar: data.registrar, status: data.status, - technicalContact: data.technical_contact ? unmarshalContact(data.technical_contact) : undefined, + technicalContact: data.technical_contact + ? unmarshalContact(data.technical_contact) + : undefined, tld: data.tld ? unmarshalTld(data.tld) : undefined, - transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined, + transferRegistrationStatus: data.transfer_registration_status + ? unmarshalDomainRegistrationStatusTransfer( + data.transfer_registration_status, + ) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as Domain } -export const unmarshalGetDNSZoneTsigKeyResponse = (data: unknown): GetDNSZoneTsigKeyResponse => { +export const unmarshalGetDNSZoneTsigKeyResponse = ( + data: unknown, +): GetDNSZoneTsigKeyResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDNSZoneTsigKeyResponse' failed as data isn't a dictionary.`, @@ -562,7 +624,9 @@ export const unmarshalGetDNSZoneTsigKeyResponse = (data: unknown): GetDNSZoneTsi } as GetDNSZoneTsigKeyResponse } -const unmarshalDomainRecordGeoIPConfigMatch = (data: unknown): DomainRecordGeoIPConfigMatch => { +const unmarshalDomainRecordGeoIPConfigMatch = ( + data: unknown, +): DomainRecordGeoIPConfigMatch => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordGeoIPConfigMatch' failed as data isn't a dictionary.`, @@ -576,7 +640,9 @@ const unmarshalDomainRecordGeoIPConfigMatch = (data: unknown): DomainRecordGeoIP } as DomainRecordGeoIPConfigMatch } -const unmarshalDomainRecordViewConfigView = (data: unknown): DomainRecordViewConfigView => { +const unmarshalDomainRecordViewConfigView = ( + data: unknown, +): DomainRecordViewConfigView => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordViewConfigView' failed as data isn't a dictionary.`, @@ -589,7 +655,9 @@ const unmarshalDomainRecordViewConfigView = (data: unknown): DomainRecordViewCon } as DomainRecordViewConfigView } -const unmarshalDomainRecordWeightedConfigWeightedIP = (data: unknown): DomainRecordWeightedConfigWeightedIP => { +const unmarshalDomainRecordWeightedConfigWeightedIP = ( + data: unknown, +): DomainRecordWeightedConfigWeightedIP => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordWeightedConfigWeightedIP' failed as data isn't a dictionary.`, @@ -602,7 +670,9 @@ const unmarshalDomainRecordWeightedConfigWeightedIP = (data: unknown): DomainRec } as DomainRecordWeightedConfigWeightedIP } -const unmarshalDomainRecordGeoIPConfig = (data: unknown): DomainRecordGeoIPConfig => { +const unmarshalDomainRecordGeoIPConfig = ( + data: unknown, +): DomainRecordGeoIPConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordGeoIPConfig' failed as data isn't a dictionary.`, @@ -611,11 +681,16 @@ const unmarshalDomainRecordGeoIPConfig = (data: unknown): DomainRecordGeoIPConfi return { default: data.default, - matches: unmarshalArrayOfObject(data.matches, unmarshalDomainRecordGeoIPConfigMatch), + matches: unmarshalArrayOfObject( + data.matches, + unmarshalDomainRecordGeoIPConfigMatch, + ), } as DomainRecordGeoIPConfig } -const unmarshalDomainRecordHTTPServiceConfig = (data: unknown): DomainRecordHTTPServiceConfig => { +const unmarshalDomainRecordHTTPServiceConfig = ( + data: unknown, +): DomainRecordHTTPServiceConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordHTTPServiceConfig' failed as data isn't a dictionary.`, @@ -631,7 +706,9 @@ const unmarshalDomainRecordHTTPServiceConfig = (data: unknown): DomainRecordHTTP } as DomainRecordHTTPServiceConfig } -const unmarshalDomainRecordViewConfig = (data: unknown): DomainRecordViewConfig => { +const unmarshalDomainRecordViewConfig = ( + data: unknown, +): DomainRecordViewConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordViewConfig' failed as data isn't a dictionary.`, @@ -639,11 +716,16 @@ const unmarshalDomainRecordViewConfig = (data: unknown): DomainRecordViewConfig } return { - views: unmarshalArrayOfObject(data.views, unmarshalDomainRecordViewConfigView), + views: unmarshalArrayOfObject( + data.views, + unmarshalDomainRecordViewConfigView, + ), } as DomainRecordViewConfig } -const unmarshalDomainRecordWeightedConfig = (data: unknown): DomainRecordWeightedConfig => { +const unmarshalDomainRecordWeightedConfig = ( + data: unknown, +): DomainRecordWeightedConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainRecordWeightedConfig' failed as data isn't a dictionary.`, @@ -651,7 +733,10 @@ const unmarshalDomainRecordWeightedConfig = (data: unknown): DomainRecordWeighte } return { - weightedIps: unmarshalArrayOfObject(data.weighted_ips, unmarshalDomainRecordWeightedConfigWeightedIP), + weightedIps: unmarshalArrayOfObject( + data.weighted_ips, + unmarshalDomainRecordWeightedConfigWeightedIP, + ), } as DomainRecordWeightedConfig } @@ -665,15 +750,23 @@ const unmarshalDomainRecord = (data: unknown): DomainRecord => { return { comment: data.comment, data: data.data, - geoIpConfig: data.geo_ip_config ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) : undefined, - httpServiceConfig: data.http_service_config ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) : undefined, + geoIpConfig: data.geo_ip_config + ? unmarshalDomainRecordGeoIPConfig(data.geo_ip_config) + : undefined, + httpServiceConfig: data.http_service_config + ? unmarshalDomainRecordHTTPServiceConfig(data.http_service_config) + : undefined, id: data.id, name: data.name, priority: data.priority, ttl: data.ttl, type: data.type, - viewConfig: data.view_config ? unmarshalDomainRecordViewConfig(data.view_config) : undefined, - weightedConfig: data.weighted_config ? unmarshalDomainRecordWeightedConfig(data.weighted_config) : undefined, + viewConfig: data.view_config + ? unmarshalDomainRecordViewConfig(data.view_config) + : undefined, + weightedConfig: data.weighted_config + ? unmarshalDomainRecordWeightedConfig(data.weighted_config) + : undefined, } as DomainRecord } @@ -711,8 +804,7 @@ const unmarshalRecordChangeClear = (data: unknown): RecordChangeClear => { ) } - return { - } as RecordChangeClear + return {} as RecordChangeClear } const unmarshalRecordChangeDelete = (data: unknown): RecordChangeDelete => { @@ -724,7 +816,9 @@ const unmarshalRecordChangeDelete = (data: unknown): RecordChangeDelete => { return { id: data.id, - idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined, + idFields: data.id_fields + ? unmarshalRecordIdentifier(data.id_fields) + : undefined, } as RecordChangeDelete } @@ -737,7 +831,9 @@ const unmarshalRecordChangeSet = (data: unknown): RecordChangeSet => { return { id: data.id, - idFields: data.id_fields ? unmarshalRecordIdentifier(data.id_fields) : undefined, + idFields: data.id_fields + ? unmarshalRecordIdentifier(data.id_fields) + : undefined, records: unmarshalArrayOfObject(data.records, unmarshalDomainRecord), } as RecordChangeSet } @@ -757,7 +853,9 @@ const unmarshalRecordChange = (data: unknown): RecordChange => { } as RecordChange } -export const unmarshalGetDNSZoneVersionDiffResponse = (data: unknown): GetDNSZoneVersionDiffResponse => { +export const unmarshalGetDNSZoneVersionDiffResponse = ( + data: unknown, +): GetDNSZoneVersionDiffResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDNSZoneVersionDiffResponse' failed as data isn't a dictionary.`, @@ -769,7 +867,9 @@ export const unmarshalGetDNSZoneVersionDiffResponse = (data: unknown): GetDNSZon } as GetDNSZoneVersionDiffResponse } -export const unmarshalGetDomainAuthCodeResponse = (data: unknown): GetDomainAuthCodeResponse => { +export const unmarshalGetDomainAuthCodeResponse = ( + data: unknown, +): GetDomainAuthCodeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDomainAuthCodeResponse' failed as data isn't a dictionary.`, @@ -781,7 +881,9 @@ export const unmarshalGetDomainAuthCodeResponse = (data: unknown): GetDomainAuth } as GetDomainAuthCodeResponse } -export const unmarshalImportProviderDNSZoneResponse = (data: unknown): ImportProviderDNSZoneResponse => { +export const unmarshalImportProviderDNSZoneResponse = ( + data: unknown, +): ImportProviderDNSZoneResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ImportProviderDNSZoneResponse' failed as data isn't a dictionary.`, @@ -793,7 +895,9 @@ export const unmarshalImportProviderDNSZoneResponse = (data: unknown): ImportPro } as ImportProviderDNSZoneResponse } -export const unmarshalImportRawDNSZoneResponse = (data: unknown): ImportRawDNSZoneResponse => { +export const unmarshalImportRawDNSZoneResponse = ( + data: unknown, +): ImportRawDNSZoneResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ImportRawDNSZoneResponse' failed as data isn't a dictionary.`, @@ -832,7 +936,9 @@ const unmarshalContactRoles = (data: unknown): ContactRoles => { } as ContactRoles } -export const unmarshalListContactsResponse = (data: unknown): ListContactsResponse => { +export const unmarshalListContactsResponse = ( + data: unknown, +): ListContactsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListContactsResponse' failed as data isn't a dictionary.`, @@ -858,7 +964,9 @@ const unmarshalNameserver = (data: unknown): Nameserver => { } as Nameserver } -export const unmarshalListDNSZoneNameserversResponse = (data: unknown): ListDNSZoneNameserversResponse => { +export const unmarshalListDNSZoneNameserversResponse = ( + data: unknown, +): ListDNSZoneNameserversResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSZoneNameserversResponse' failed as data isn't a dictionary.`, @@ -870,7 +978,9 @@ export const unmarshalListDNSZoneNameserversResponse = (data: unknown): ListDNSZ } as ListDNSZoneNameserversResponse } -export const unmarshalListDNSZoneRecordsResponse = (data: unknown): ListDNSZoneRecordsResponse => { +export const unmarshalListDNSZoneRecordsResponse = ( + data: unknown, +): ListDNSZoneRecordsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSZoneRecordsResponse' failed as data isn't a dictionary.`, @@ -883,7 +993,9 @@ export const unmarshalListDNSZoneRecordsResponse = (data: unknown): ListDNSZoneR } as ListDNSZoneRecordsResponse } -export const unmarshalListDNSZoneVersionRecordsResponse = (data: unknown): ListDNSZoneVersionRecordsResponse => { +export const unmarshalListDNSZoneVersionRecordsResponse = ( + data: unknown, +): ListDNSZoneVersionRecordsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSZoneVersionRecordsResponse' failed as data isn't a dictionary.`, @@ -909,7 +1021,9 @@ const unmarshalDNSZoneVersion = (data: unknown): DNSZoneVersion => { } as DNSZoneVersion } -export const unmarshalListDNSZoneVersionsResponse = (data: unknown): ListDNSZoneVersionsResponse => { +export const unmarshalListDNSZoneVersionsResponse = ( + data: unknown, +): ListDNSZoneVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSZoneVersionsResponse' failed as data isn't a dictionary.`, @@ -922,7 +1036,9 @@ export const unmarshalListDNSZoneVersionsResponse = (data: unknown): ListDNSZone } as ListDNSZoneVersionsResponse } -export const unmarshalListDNSZonesResponse = (data: unknown): ListDNSZonesResponse => { +export const unmarshalListDNSZonesResponse = ( + data: unknown, +): ListDNSZonesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSZonesResponse' failed as data isn't a dictionary.`, @@ -935,7 +1051,9 @@ export const unmarshalListDNSZonesResponse = (data: unknown): ListDNSZonesRespon } as ListDNSZonesResponse } -export const unmarshalListDomainHostsResponse = (data: unknown): ListDomainHostsResponse => { +export const unmarshalListDomainHostsResponse = ( + data: unknown, +): ListDomainHostsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDomainHostsResponse' failed as data isn't a dictionary.`, @@ -962,19 +1080,29 @@ const unmarshalDomainSummary = (data: unknown): DomainSummary => { domain: data.domain, eppCode: data.epp_code, expiredAt: unmarshalDate(data.expired_at), - externalDomainRegistrationStatus: data.external_domain_registration_status ? unmarshalDomainRegistrationStatusExternalDomain(data.external_domain_registration_status) : undefined, + externalDomainRegistrationStatus: data.external_domain_registration_status + ? unmarshalDomainRegistrationStatusExternalDomain( + data.external_domain_registration_status, + ) + : undefined, isExternal: data.is_external, organizationId: data.organization_id, pendingTrade: data.pending_trade, projectId: data.project_id, registrar: data.registrar, status: data.status, - transferRegistrationStatus: data.transfer_registration_status ? unmarshalDomainRegistrationStatusTransfer(data.transfer_registration_status) : undefined, + transferRegistrationStatus: data.transfer_registration_status + ? unmarshalDomainRegistrationStatusTransfer( + data.transfer_registration_status, + ) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as DomainSummary } -export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse => { +export const unmarshalListDomainsResponse = ( + data: unknown, +): ListDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`, @@ -1006,7 +1134,9 @@ const unmarshalInboundTransfer = (data: unknown): InboundTransfer => { } as InboundTransfer } -export const unmarshalListInboundTransfersResponse = (data: unknown): ListInboundTransfersResponse => { +export const unmarshalListInboundTransfersResponse = ( + data: unknown, +): ListInboundTransfersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInboundTransfersResponse' failed as data isn't a dictionary.`, @@ -1014,7 +1144,10 @@ export const unmarshalListInboundTransfersResponse = (data: unknown): ListInboun } return { - inboundTransfers: unmarshalArrayOfObject(data.inbound_transfers, unmarshalInboundTransfer), + inboundTransfers: unmarshalArrayOfObject( + data.inbound_transfers, + unmarshalInboundTransfer, + ), totalCount: data.total_count, } as ListInboundTransfersResponse } @@ -1040,7 +1173,9 @@ const unmarshalRenewableDomain = (data: unknown): RenewableDomain => { } as RenewableDomain } -export const unmarshalListRenewableDomainsResponse = (data: unknown): ListRenewableDomainsResponse => { +export const unmarshalListRenewableDomainsResponse = ( + data: unknown, +): ListRenewableDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRenewableDomainsResponse' failed as data isn't a dictionary.`, @@ -1053,7 +1188,9 @@ export const unmarshalListRenewableDomainsResponse = (data: unknown): ListRenewa } as ListRenewableDomainsResponse } -export const unmarshalListSSLCertificatesResponse = (data: unknown): ListSSLCertificatesResponse => { +export const unmarshalListSSLCertificatesResponse = ( + data: unknown, +): ListSSLCertificatesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSSLCertificatesResponse' failed as data isn't a dictionary.`, @@ -1061,7 +1198,10 @@ export const unmarshalListSSLCertificatesResponse = (data: unknown): ListSSLCert } return { - certificates: unmarshalArrayOfObject(data.certificates, unmarshalSSLCertificate), + certificates: unmarshalArrayOfObject( + data.certificates, + unmarshalSSLCertificate, + ), totalCount: data.total_count, } as ListSSLCertificatesResponse } @@ -1087,7 +1227,9 @@ export const unmarshalTask = (data: unknown): Task => { } as Task } -export const unmarshalListTasksResponse = (data: unknown): ListTasksResponse => { +export const unmarshalListTasksResponse = ( + data: unknown, +): ListTasksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTasksResponse' failed as data isn't a dictionary.`, @@ -1129,7 +1271,9 @@ export const unmarshalOrderResponse = (data: unknown): OrderResponse => { } as OrderResponse } -export const unmarshalRefreshDNSZoneResponse = (data: unknown): RefreshDNSZoneResponse => { +export const unmarshalRefreshDNSZoneResponse = ( + data: unknown, +): RefreshDNSZoneResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RefreshDNSZoneResponse' failed as data isn't a dictionary.`, @@ -1141,7 +1285,9 @@ export const unmarshalRefreshDNSZoneResponse = (data: unknown): RefreshDNSZoneRe } as RefreshDNSZoneResponse } -export const unmarshalRegisterExternalDomainResponse = (data: unknown): RegisterExternalDomainResponse => { +export const unmarshalRegisterExternalDomainResponse = ( + data: unknown, +): RegisterExternalDomainResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RegisterExternalDomainResponse' failed as data isn't a dictionary.`, @@ -1157,26 +1303,28 @@ export const unmarshalRegisterExternalDomainResponse = (data: unknown): Register } as RegisterExternalDomainResponse } -export const unmarshalRestoreDNSZoneVersionResponse = (data: unknown): RestoreDNSZoneVersionResponse => { +export const unmarshalRestoreDNSZoneVersionResponse = ( + data: unknown, +): RestoreDNSZoneVersionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RestoreDNSZoneVersionResponse' failed as data isn't a dictionary.`, ) } - return { - } as RestoreDNSZoneVersionResponse + return {} as RestoreDNSZoneVersionResponse } -export const unmarshalRetryInboundTransferResponse = (data: unknown): RetryInboundTransferResponse => { +export const unmarshalRetryInboundTransferResponse = ( + data: unknown, +): RetryInboundTransferResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RetryInboundTransferResponse' failed as data isn't a dictionary.`, ) } - return { - } as RetryInboundTransferResponse + return {} as RetryInboundTransferResponse } const unmarshalAvailableDomain = (data: unknown): AvailableDomain => { @@ -1193,20 +1341,9 @@ const unmarshalAvailableDomain = (data: unknown): AvailableDomain => { } as AvailableDomain } -export const unmarshalSearchAvailableDomainsConsoleResponse = (data: unknown): SearchAvailableDomainsConsoleResponse => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'SearchAvailableDomainsConsoleResponse' failed as data isn't a dictionary.`, - ) - } - - return { - availableDomains: unmarshalArrayOfObject(data.available_domains, unmarshalAvailableDomain), - exactMatchDomain: data.exact_match_domain ? unmarshalAvailableDomain(data.exact_match_domain) : undefined, - } as SearchAvailableDomainsConsoleResponse -} - -export const unmarshalSearchAvailableDomainsResponse = (data: unknown): SearchAvailableDomainsResponse => { +export const unmarshalSearchAvailableDomainsResponse = ( + data: unknown, +): SearchAvailableDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SearchAvailableDomainsResponse' failed as data isn't a dictionary.`, @@ -1214,11 +1351,16 @@ export const unmarshalSearchAvailableDomainsResponse = (data: unknown): SearchAv } return { - availableDomains: unmarshalArrayOfObject(data.available_domains, unmarshalAvailableDomain), + availableDomains: unmarshalArrayOfObject( + data.available_domains, + unmarshalAvailableDomain, + ), } as SearchAvailableDomainsResponse } -export const unmarshalUpdateDNSZoneNameserversResponse = (data: unknown): UpdateDNSZoneNameserversResponse => { +export const unmarshalUpdateDNSZoneNameserversResponse = ( + data: unknown, +): UpdateDNSZoneNameserversResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateDNSZoneNameserversResponse' failed as data isn't a dictionary.`, @@ -1230,7 +1372,9 @@ export const unmarshalUpdateDNSZoneNameserversResponse = (data: unknown): Update } as UpdateDNSZoneNameserversResponse } -export const unmarshalUpdateDNSZoneRecordsResponse = (data: unknown): UpdateDNSZoneRecordsResponse => { +export const unmarshalUpdateDNSZoneRecordsResponse = ( + data: unknown, +): UpdateDNSZoneRecordsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateDNSZoneRecordsResponse' failed as data isn't a dictionary.`, @@ -1278,11 +1422,17 @@ const marshalImportProviderDNSZoneRequestOnlineV1 = ( export const marshalImportProviderDNSZoneRequest = ( request: ImportProviderDNSZoneRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'online_v1', - value: (request.onlineV1 !== undefined) ? marshalImportProviderDNSZoneRequestOnlineV1(request.onlineV1, defaults) - : undefined, + { + param: 'online_v1', + value: + request.onlineV1 !== undefined + ? marshalImportProviderDNSZoneRequestOnlineV1( + request.onlineV1, + defaults, + ) + : undefined, }, ]), }) @@ -1301,7 +1451,10 @@ const marshalImportRawDNSZoneRequestAXFRSource = ( defaults: DefaultValues, ): Record => ({ name_server: request.nameServer, - tsig_key: ((request.tsigKey !== undefined) ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey, defaults): undefined), + tsig_key: + request.tsigKey !== undefined + ? marshalImportRawDNSZoneRequestTsigKey(request.tsigKey, defaults) + : undefined, }) const marshalImportRawDNSZoneRequestBindSource = ( @@ -1317,15 +1470,27 @@ export const marshalImportRawDNSZoneRequest = ( ): Record => ({ content: request.content, format: request.format, - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf([ - {param: 'bind_source', - value: (request.bindSource !== undefined) ? marshalImportRawDNSZoneRequestBindSource(request.bindSource, defaults) - : undefined, + { + param: 'bind_source', + value: + request.bindSource !== undefined + ? marshalImportRawDNSZoneRequestBindSource( + request.bindSource, + defaults, + ) + : undefined, }, - {param: 'axfr_source', - value: (request.axfrSource !== undefined) ? marshalImportRawDNSZoneRequestAXFRSource(request.axfrSource, defaults) - : undefined, + { + param: 'axfr_source', + value: + request.axfrSource !== undefined + ? marshalImportRawDNSZoneRequestAXFRSource( + request.axfrSource, + defaults, + ) + : undefined, }, ]), }) @@ -1386,39 +1551,58 @@ const marshalContactExtensionFR = ( request: ContactExtensionFR, defaults: DefaultValues, ): Record => ({ - mode: request.mode, + mode: request.mode, ...resolveOneOf([ - {param: 'individual_info', - value: (request.individualInfo !== undefined) ? marshalContactExtensionFRIndividualInfo(request.individualInfo, defaults) - : undefined, + { + param: 'individual_info', + value: + request.individualInfo !== undefined + ? marshalContactExtensionFRIndividualInfo( + request.individualInfo, + defaults, + ) + : undefined, }, - {param: 'duns_info', - value: (request.dunsInfo !== undefined) ? marshalContactExtensionFRDunsInfo(request.dunsInfo, defaults) - : undefined, + { + param: 'duns_info', + value: + request.dunsInfo !== undefined + ? marshalContactExtensionFRDunsInfo(request.dunsInfo, defaults) + : undefined, }, - {param: 'association_info', - value: (request.associationInfo !== undefined) ? marshalContactExtensionFRAssociationInfo(request.associationInfo, defaults) - : undefined, + { + param: 'association_info', + value: + request.associationInfo !== undefined + ? marshalContactExtensionFRAssociationInfo( + request.associationInfo, + defaults, + ) + : undefined, }, - {param: 'trademark_info', - value: (request.trademarkInfo !== undefined) ? marshalContactExtensionFRTrademarkInfo(request.trademarkInfo, defaults) - : undefined, + { + param: 'trademark_info', + value: + request.trademarkInfo !== undefined + ? marshalContactExtensionFRTrademarkInfo( + request.trademarkInfo, + defaults, + ) + : undefined, }, - {param: 'code_auth_afnic_info', - value: (request.codeAuthAfnicInfo !== undefined) ? marshalContactExtensionFRCodeAuthAfnicInfo(request.codeAuthAfnicInfo, defaults) - : undefined, + { + param: 'code_auth_afnic_info', + value: + request.codeAuthAfnicInfo !== undefined + ? marshalContactExtensionFRCodeAuthAfnicInfo( + request.codeAuthAfnicInfo, + defaults, + ) + : undefined, }, ]), }) -const marshalContactExtensionIT = ( - request: ContactExtensionIT, - defaults: DefaultValues, -): Record => ({ - european_citizenship: request.europeanCitizenship, - tax_code: request.taxCode, -}) - const marshalContactExtensionNL = ( request: ContactExtensionNL, defaults: DefaultValues, @@ -1447,17 +1631,28 @@ const marshalNewContact = ( country: request.country, email: request.email, email_alt: request.emailAlt, - extension_eu: ((request.extensionEu !== undefined) ? marshalContactExtensionEU(request.extensionEu, defaults): undefined), - extension_fr: ((request.extensionFr !== undefined) ? marshalContactExtensionFR(request.extensionFr, defaults): undefined), - extension_it: ((request.extensionIt !== undefined) ? marshalContactExtensionIT(request.extensionIt, defaults): undefined), - extension_nl: ((request.extensionNl !== undefined) ? marshalContactExtensionNL(request.extensionNl, defaults): undefined), + extension_eu: + request.extensionEu !== undefined + ? marshalContactExtensionEU(request.extensionEu, defaults) + : undefined, + extension_fr: + request.extensionFr !== undefined + ? marshalContactExtensionFR(request.extensionFr, defaults) + : undefined, + extension_nl: + request.extensionNl !== undefined + ? marshalContactExtensionNL(request.extensionNl, defaults) + : undefined, fax_number: request.faxNumber, firstname: request.firstname, lang: request.lang, lastname: request.lastname, legal_form: request.legalForm, phone_number: request.phoneNumber, - questions: ((request.questions !== undefined) ? request.questions.map(elt => marshalContactQuestion(elt, defaults)): undefined), + questions: + request.questions !== undefined + ? request.questions.map(elt => marshalContactQuestion(elt, defaults)) + : undefined, resale: request.resale, state: request.state, vat_identification_code: request.vatIdentificationCode, @@ -1471,32 +1666,38 @@ export const marshalRegistrarApiBuyDomainsRequest = ( ): Record => ({ domains: request.domains, duration_in_years: request.durationInYears, - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf>([ - {param: 'owner_contact_id', - value: request.ownerContactId, - }, - {param: 'owner_contact', - value: (request.ownerContact !== undefined) ? marshalNewContact(request.ownerContact, defaults) - : undefined, + { param: 'owner_contact_id', value: request.ownerContactId }, + { + param: 'owner_contact', + value: + request.ownerContact !== undefined + ? marshalNewContact(request.ownerContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'administrative_contact_id', + { + param: 'administrative_contact_id', value: request.administrativeContactId, }, - {param: 'administrative_contact', - value: (request.administrativeContact !== undefined) ? marshalNewContact(request.administrativeContact, defaults) - : undefined, + { + param: 'administrative_contact', + value: + request.administrativeContact !== undefined + ? marshalNewContact(request.administrativeContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'technical_contact_id', - value: request.technicalContactId, - }, - {param: 'technical_contact', - value: (request.technicalContact !== undefined) ? marshalNewContact(request.technicalContact, defaults) - : undefined, + { param: 'technical_contact_id', value: request.technicalContactId }, + { + param: 'technical_contact', + value: + request.technicalContact !== undefined + ? marshalNewContact(request.technicalContact, defaults) + : undefined, }, ]), }) @@ -1506,32 +1707,38 @@ export const marshalRegistrarApiCheckContactsCompatibilityRequest = ( defaults: DefaultValues, ): Record => ({ domains: request.domains, - tlds: request.tlds, + tlds: request.tlds, ...resolveOneOf>([ - {param: 'owner_contact_id', - value: request.ownerContactId, - }, - {param: 'owner_contact', - value: (request.ownerContact !== undefined) ? marshalNewContact(request.ownerContact, defaults) - : undefined, + { param: 'owner_contact_id', value: request.ownerContactId }, + { + param: 'owner_contact', + value: + request.ownerContact !== undefined + ? marshalNewContact(request.ownerContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'administrative_contact_id', + { + param: 'administrative_contact_id', value: request.administrativeContactId, }, - {param: 'administrative_contact', - value: (request.administrativeContact !== undefined) ? marshalNewContact(request.administrativeContact, defaults) - : undefined, + { + param: 'administrative_contact', + value: + request.administrativeContact !== undefined + ? marshalNewContact(request.administrativeContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'technical_contact_id', - value: request.technicalContactId, - }, - {param: 'technical_contact', - value: (request.technicalContact !== undefined) ? marshalNewContact(request.technicalContact, defaults) - : undefined, + { param: 'technical_contact_id', value: request.technicalContactId }, + { + param: 'technical_contact', + value: + request.technicalContact !== undefined + ? marshalNewContact(request.technicalContact, defaults) + : undefined, }, ]), }) @@ -1556,7 +1763,10 @@ const marshalDSRecordDigest = ( defaults: DefaultValues, ): Record => ({ digest: request.digest, - public_key: ((request.publicKey !== undefined) ? marshalDSRecordPublicKey(request.publicKey, defaults): undefined), + public_key: + request.publicKey !== undefined + ? marshalDSRecordPublicKey(request.publicKey, defaults) + : undefined, type: request.type, }) @@ -1565,15 +1775,21 @@ export const marshalDSRecord = ( defaults: DefaultValues, ): Record => ({ algorithm: request.algorithm, - key_id: request.keyId, + key_id: request.keyId, ...resolveOneOf([ - {param: 'digest', - value: (request.digest !== undefined) ? marshalDSRecordDigest(request.digest, defaults) - : undefined, + { + param: 'digest', + value: + request.digest !== undefined + ? marshalDSRecordDigest(request.digest, defaults) + : undefined, }, - {param: 'public_key', - value: (request.publicKey !== undefined) ? marshalDSRecordPublicKey(request.publicKey, defaults) - : undefined, + { + param: 'public_key', + value: + request.publicKey !== undefined + ? marshalDSRecordPublicKey(request.publicKey, defaults) + : undefined, }, ]), }) @@ -1582,7 +1798,10 @@ export const marshalRegistrarApiEnableDomainDNSSECRequest = ( request: RegistrarApiEnableDomainDNSSECRequest, defaults: DefaultValues, ): Record => ({ - ds_record: ((request.dsRecord !== undefined) ? marshalDSRecord(request.dsRecord, defaults): undefined), + ds_record: + request.dsRecord !== undefined + ? marshalDSRecord(request.dsRecord, defaults) + : undefined, }) export const marshalRegistrarApiRegisterExternalDomainRequest = ( @@ -1615,14 +1834,15 @@ export const marshalRegistrarApiTradeDomainRequest = ( request: RegistrarApiTradeDomainRequest, defaults: DefaultValues, ): Record => ({ - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf>([ - {param: 'new_owner_contact_id', - value: request.newOwnerContactId, - }, - {param: 'new_owner_contact', - value: (request.newOwnerContact !== undefined) ? marshalNewContact(request.newOwnerContact, defaults) - : undefined, + { param: 'new_owner_contact_id', value: request.newOwnerContactId }, + { + param: 'new_owner_contact', + value: + request.newOwnerContact !== undefined + ? marshalNewContact(request.newOwnerContact, defaults) + : undefined, }, ]), }) @@ -1639,33 +1859,41 @@ export const marshalRegistrarApiTransferInDomainRequest = ( request: RegistrarApiTransferInDomainRequest, defaults: DefaultValues, ): Record => ({ - domains: request.domains.map(elt => marshalTransferInDomainRequestTransferRequest(elt, defaults)), - project_id: request.projectId ?? defaults.defaultProjectId, + domains: request.domains.map(elt => + marshalTransferInDomainRequestTransferRequest(elt, defaults), + ), + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf>([ - {param: 'owner_contact_id', - value: request.ownerContactId, + { param: 'owner_contact_id', value: request.ownerContactId }, + { + param: 'owner_contact', + value: + request.ownerContact !== undefined + ? marshalNewContact(request.ownerContact, defaults) + : undefined, }, - {param: 'owner_contact', - value: (request.ownerContact !== undefined) ? marshalNewContact(request.ownerContact, defaults) - : undefined, - }, - ]), + ]), ...resolveOneOf>([ - {param: 'administrative_contact_id', + { + param: 'administrative_contact_id', value: request.administrativeContactId, }, - {param: 'administrative_contact', - value: (request.administrativeContact !== undefined) ? marshalNewContact(request.administrativeContact, defaults) - : undefined, + { + param: 'administrative_contact', + value: + request.administrativeContact !== undefined + ? marshalNewContact(request.administrativeContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'technical_contact_id', - value: request.technicalContactId, - }, - {param: 'technical_contact', - value: (request.technicalContact !== undefined) ? marshalNewContact(request.technicalContact, defaults) - : undefined, + { param: 'technical_contact_id', value: request.technicalContactId }, + { + param: 'technical_contact', + value: + request.technicalContact !== undefined + ? marshalNewContact(request.technicalContact, defaults) + : undefined, }, ]), }) @@ -1689,14 +1917,27 @@ export const marshalRegistrarApiUpdateContactRequest = ( country: request.country, email: request.email, email_alt: request.emailAlt, - extension_eu: ((request.extensionEu !== undefined) ? marshalContactExtensionEU(request.extensionEu, defaults): undefined), - extension_fr: ((request.extensionFr !== undefined) ? marshalContactExtensionFR(request.extensionFr, defaults): undefined), - extension_it: ((request.extensionIt !== undefined) ? marshalContactExtensionIT(request.extensionIt, defaults): undefined), - extension_nl: ((request.extensionNl !== undefined) ? marshalContactExtensionNL(request.extensionNl, defaults): undefined), + extension_eu: + request.extensionEu !== undefined + ? marshalContactExtensionEU(request.extensionEu, defaults) + : undefined, + extension_fr: + request.extensionFr !== undefined + ? marshalContactExtensionFR(request.extensionFr, defaults) + : undefined, + extension_nl: + request.extensionNl !== undefined + ? marshalContactExtensionNL(request.extensionNl, defaults) + : undefined, fax_number: request.faxNumber, lang: request.lang, phone_number: request.phoneNumber, - questions: ((request.questions !== undefined) ? request.questions.map(elt => marshalUpdateContactRequestQuestion(elt, defaults)): undefined), + questions: + request.questions !== undefined + ? request.questions.map(elt => + marshalUpdateContactRequestQuestion(elt, defaults), + ) + : undefined, resale: request.resale, state: request.state, vat_identification_code: request.vatIdentificationCode, @@ -1714,32 +1955,38 @@ export const marshalRegistrarApiUpdateDomainHostRequest = ( export const marshalRegistrarApiUpdateDomainRequest = ( request: RegistrarApiUpdateDomainRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf>([ - {param: 'technical_contact_id', - value: request.technicalContactId, + { param: 'technical_contact_id', value: request.technicalContactId }, + { + param: 'technical_contact', + value: + request.technicalContact !== undefined + ? marshalNewContact(request.technicalContact, defaults) + : undefined, }, - {param: 'technical_contact', - value: (request.technicalContact !== undefined) ? marshalNewContact(request.technicalContact, defaults) - : undefined, - }, - ]), + ]), ...resolveOneOf>([ - {param: 'owner_contact_id', - value: request.ownerContactId, - }, - {param: 'owner_contact', - value: (request.ownerContact !== undefined) ? marshalNewContact(request.ownerContact, defaults) - : undefined, + { param: 'owner_contact_id', value: request.ownerContactId }, + { + param: 'owner_contact', + value: + request.ownerContact !== undefined + ? marshalNewContact(request.ownerContact, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf>([ - {param: 'administrative_contact_id', + { + param: 'administrative_contact_id', value: request.administrativeContactId, }, - {param: 'administrative_contact', - value: (request.administrativeContact !== undefined) ? marshalNewContact(request.administrativeContact, defaults) - : undefined, + { + param: 'administrative_contact', + value: + request.administrativeContact !== undefined + ? marshalNewContact(request.administrativeContact, defaults) + : undefined, }, ]), }) @@ -1756,7 +2003,7 @@ export const marshalUpdateDNSZoneNameserversRequest = ( request: UpdateDNSZoneNameserversRequest, defaults: DefaultValues, ): Record => ({ - ns: request.ns.map(elt => marshalNameserver(elt, defaults)), + ns: request.ns.map(elt => marshalNameserver(elt, defaults)), }) const marshalDomainRecordGeoIPConfigMatch = ( @@ -1789,7 +2036,9 @@ const marshalDomainRecordGeoIPConfig = ( defaults: DefaultValues, ): Record => ({ default: request.default, - matches: request.matches.map(elt => marshalDomainRecordGeoIPConfigMatch(elt, defaults)), + matches: request.matches.map(elt => + marshalDomainRecordGeoIPConfigMatch(elt, defaults), + ), }) const marshalDomainRecordHTTPServiceConfig = ( @@ -1807,14 +2056,18 @@ const marshalDomainRecordViewConfig = ( request: DomainRecordViewConfig, defaults: DefaultValues, ): Record => ({ - views: request.views.map(elt => marshalDomainRecordViewConfigView(elt, defaults)), + views: request.views.map(elt => + marshalDomainRecordViewConfigView(elt, defaults), + ), }) const marshalDomainRecordWeightedConfig = ( request: DomainRecordWeightedConfig, defaults: DefaultValues, ): Record => ({ - weighted_ips: request.weightedIps.map(elt => marshalDomainRecordWeightedConfigWeightedIP(elt, defaults)), + weighted_ips: request.weightedIps.map(elt => + marshalDomainRecordWeightedConfigWeightedIP(elt, defaults), + ), }) const marshalDomainRecord = ( @@ -1827,23 +2080,38 @@ const marshalDomainRecord = ( name: request.name, priority: request.priority, ttl: request.ttl, - type: request.type, + type: request.type, ...resolveOneOf([ - {param: 'geo_ip_config', - value: (request.geoIpConfig !== undefined) ? marshalDomainRecordGeoIPConfig(request.geoIpConfig, defaults) - : undefined, + { + param: 'geo_ip_config', + value: + request.geoIpConfig !== undefined + ? marshalDomainRecordGeoIPConfig(request.geoIpConfig, defaults) + : undefined, }, - {param: 'http_service_config', - value: (request.httpServiceConfig !== undefined) ? marshalDomainRecordHTTPServiceConfig(request.httpServiceConfig, defaults) - : undefined, + { + param: 'http_service_config', + value: + request.httpServiceConfig !== undefined + ? marshalDomainRecordHTTPServiceConfig( + request.httpServiceConfig, + defaults, + ) + : undefined, }, - {param: 'weighted_config', - value: (request.weightedConfig !== undefined) ? marshalDomainRecordWeightedConfig(request.weightedConfig, defaults) - : undefined, + { + param: 'weighted_config', + value: + request.weightedConfig !== undefined + ? marshalDomainRecordWeightedConfig(request.weightedConfig, defaults) + : undefined, }, - {param: 'view_config', - value: (request.viewConfig !== undefined) ? marshalDomainRecordViewConfig(request.viewConfig, defaults) - : undefined, + { + param: 'view_config', + value: + request.viewConfig !== undefined + ? marshalDomainRecordViewConfig(request.viewConfig, defaults) + : undefined, }, ]), }) @@ -1862,26 +2130,26 @@ const marshalRecordChangeAdd = ( request: RecordChangeAdd, defaults: DefaultValues, ): Record => ({ - records: request.records.map(elt => marshalDomainRecord(elt, defaults)), + records: request.records.map(elt => marshalDomainRecord(elt, defaults)), }) const marshalRecordChangeClear = ( request: RecordChangeClear, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalRecordChangeDelete = ( request: RecordChangeDelete, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf>([ - {param: 'id', - value: request.id, - }, - {param: 'id_fields', - value: (request.idFields !== undefined) ? marshalRecordIdentifier(request.idFields, defaults) - : undefined, + { param: 'id', value: request.id }, + { + param: 'id_fields', + value: + request.idFields !== undefined + ? marshalRecordIdentifier(request.idFields, defaults) + : undefined, }, ]), }) @@ -1890,14 +2158,15 @@ const marshalRecordChangeSet = ( request: RecordChangeSet, defaults: DefaultValues, ): Record => ({ - records: request.records.map(elt => marshalDomainRecord(elt, defaults)), + records: request.records.map(elt => marshalDomainRecord(elt, defaults)), ...resolveOneOf>([ - {param: 'id', - value: request.id, - }, - {param: 'id_fields', - value: (request.idFields !== undefined) ? marshalRecordIdentifier(request.idFields, defaults) - : undefined, + { param: 'id', value: request.id }, + { + param: 'id_fields', + value: + request.idFields !== undefined + ? marshalRecordIdentifier(request.idFields, defaults) + : undefined, }, ]), }) @@ -1905,23 +2174,35 @@ const marshalRecordChangeSet = ( const marshalRecordChange = ( request: RecordChange, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'add', - value: (request.add !== undefined) ? marshalRecordChangeAdd(request.add, defaults) - : undefined, + { + param: 'add', + value: + request.add !== undefined + ? marshalRecordChangeAdd(request.add, defaults) + : undefined, }, - {param: 'set', - value: (request.set !== undefined) ? marshalRecordChangeSet(request.set, defaults) - : undefined, + { + param: 'set', + value: + request.set !== undefined + ? marshalRecordChangeSet(request.set, defaults) + : undefined, }, - {param: 'delete', - value: (request.delete !== undefined) ? marshalRecordChangeDelete(request.delete, defaults) - : undefined, + { + param: 'delete', + value: + request.delete !== undefined + ? marshalRecordChangeDelete(request.delete, defaults) + : undefined, }, - {param: 'clear', - value: (request.clear !== undefined) ? marshalRecordChangeClear(request.clear, defaults) - : undefined, + { + param: 'clear', + value: + request.clear !== undefined + ? marshalRecordChangeClear(request.clear, defaults) + : undefined, }, ]), }) @@ -1930,7 +2211,7 @@ export const marshalUpdateDNSZoneRecordsRequest = ( request: UpdateDNSZoneRecordsRequest, defaults: DefaultValues, ): Record => ({ - changes: request.changes.map(elt => marshalRecordChange(elt, defaults)), + changes: request.changes.map(elt => marshalRecordChange(elt, defaults)), disallow_new_zone_creation: request.disallowNewZoneCreation, return_all_records: request.returnAllRecords, serial: request.serial, diff --git a/packages_generated/domain/src/v2beta1/types.gen.ts b/packages_generated/domain/src/v2beta1/types.gen.ts index bdba0256d..7b9f77853 100644 --- a/packages_generated/domain/src/v2beta1/types.gen.ts +++ b/packages_generated/domain/src/v2beta1/types.gen.ts @@ -1,8 +1,7 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, } from '@scaleway/sdk-client' -import type {LanguageCode as StdLanguageCode,} from '@scaleway/sdk-std' - +import type { Money } from '@scaleway/sdk-client' +import type { LanguageCode as StdLanguageCode } from '@scaleway/sdk-std' export type ContactEmailStatus = | 'email_status_unknown' @@ -49,10 +48,7 @@ export type ContactLegalForm = | 'association' | 'other' -export type ContactStatus = - | 'status_unknown' - | 'active' - | 'pending' +export type ContactStatus = 'status_unknown' | 'active' | 'pending' export type DNSZoneStatus = | 'unknown' @@ -89,10 +85,7 @@ export type DomainFeatureStatus = | 'disabling' | 'disabled' -export type DomainRecordHTTPServiceConfigStrategy = - | 'random' - | 'hashed' - | 'all' +export type DomainRecordHTTPServiceConfigStrategy = 'random' | 'hashed' | 'all' export type DomainRecordType = | 'unknown' @@ -142,11 +135,7 @@ export type DomainStatus = | 'locked' | 'deleting' -export type HostStatus = - | 'unknown_status' - | 'active' - | 'updating' - | 'deleting' +export type HostStatus = 'unknown_status' | 'active' | 'updating' | 'deleting' export type InboundTransferStatus = | 'unknown' @@ -161,9 +150,7 @@ export type InboundTransferStatus = | 'err_domain_too_young' | 'err_too_many_requests' -export type LinkedProduct = - | 'unknown_product' - | 'vpc' +export type LinkedProduct = 'unknown_product' | 'vpc' export type ListContactsRequestRole = | 'unknown_role' @@ -171,9 +158,7 @@ export type ListContactsRequestRole = | 'administrative' | 'technical' -export type ListDNSZoneRecordsRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListDNSZoneRecordsRequestOrderBy = 'name_asc' | 'name_desc' export type ListDNSZonesRequestOrderBy = | 'domain_asc' @@ -185,13 +170,9 @@ export type ListDNSZonesRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListDomainsRequestOrderBy = - | 'domain_asc' - | 'domain_desc' +export type ListDomainsRequestOrderBy = 'domain_asc' | 'domain_desc' -export type ListRenewableDomainsRequestOrderBy = - | 'domain_asc' - | 'domain_desc' +export type ListRenewableDomainsRequestOrderBy = 'domain_asc' | 'domain_desc' export type ListTasksRequestOrderBy = | 'domain_desc' @@ -203,13 +184,9 @@ export type ListTasksRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListTldsRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListTldsRequestOrderBy = 'name_asc' | 'name_desc' -export type RawFormat = - | 'unknown_raw_format' - | 'bind' +export type RawFormat = 'unknown_raw_format' | 'bind' export type RenewableDomainStatus = | 'unknown' @@ -264,30 +241,25 @@ export interface DomainRecordGeoIPConfigMatch { data: string } - export interface DomainRecordViewConfigView { subnet: string data: string } - export interface DomainRecordWeightedConfigWeightedIP { ip: string weight: number } - export interface DSRecordPublicKey { key: string } - export interface DomainRecordGeoIPConfig { matches: DomainRecordGeoIPConfigMatch[] default: string } - export interface DomainRecordHTTPServiceConfig { ips: string[] mustContain?: string @@ -296,51 +268,42 @@ export interface DomainRecordHTTPServiceConfig { strategy: DomainRecordHTTPServiceConfigStrategy } - export interface DomainRecordViewConfig { views: DomainRecordViewConfigView[] } - export interface DomainRecordWeightedConfig { weightedIps: DomainRecordWeightedConfigWeightedIP[] } - export interface ContactExtensionFRAssociationInfo { publicationJo?: Date publicationJoPage: number } - export interface ContactExtensionFRCodeAuthAfnicInfo { codeAuthAfnic: string } - export interface ContactExtensionFRDunsInfo { dunsId: string localId: string } - export interface ContactExtensionFRIndividualInfo { whoisOptIn: boolean } - export interface ContactExtensionFRTrademarkInfo { trademarkInpi: string } - export interface DSRecordDigest { type: DSRecordDigestType digest: string publicKey?: DSRecordPublicKey } - export interface DomainRecord { data: string name: string @@ -371,7 +334,6 @@ export interface DomainRecord { id: string } - export interface RecordIdentifier { name: string type: DomainRecordType @@ -379,12 +341,10 @@ export interface RecordIdentifier { ttl?: number } - export interface ContactExtensionEU { europeanCitizenship: string } - export interface ContactExtensionFR { mode: ContactExtensionFRMode /** @@ -414,32 +374,22 @@ export interface ContactExtensionFR { codeAuthAfnicInfo?: ContactExtensionFRCodeAuthAfnicInfo } - -export interface ContactExtensionIT { - europeanCitizenship: string - taxCode: string -} - - export interface ContactExtensionNL { legalForm: ContactExtensionNLLegalForm legalFormRegistrationNumber: string } - export interface ContactQuestion { question: string answer: string } - export interface TldOffer { action: string operationPath: string price?: Money } - export interface DSRecord { keyId: number algorithm: DSRecordAlgorithm @@ -455,15 +405,11 @@ export interface DSRecord { publicKey?: DSRecordPublicKey } - export interface RecordChangeAdd { records: DomainRecord[] } - -export interface RecordChangeClear { -} - +export interface RecordChangeClear {} export interface RecordChangeDelete { /** @@ -478,7 +424,6 @@ export interface RecordChangeDelete { idFields?: RecordIdentifier } - export interface RecordChangeSet { /** * @@ -493,14 +438,12 @@ export interface RecordChangeSet { records: DomainRecord[] } - export interface ImportRawDNSZoneRequestTsigKey { name: string key: string algorithm: string } - export interface Contact { id: string legalForm: ContactLegalForm @@ -521,7 +464,7 @@ export interface Contact { lang: StdLanguageCode resale: boolean /** - * @deprecated + * @deprecated */ questions?: ContactQuestion[] extensionFr?: ContactExtensionFR @@ -531,29 +474,24 @@ export interface Contact { state: string extensionNl?: ContactExtensionNL status: ContactStatus - extensionIt?: ContactExtensionIT } - export interface ContactRolesRoles { isOwner: boolean isAdministrative: boolean isTechnical: boolean } - export interface DomainRegistrationStatusExternalDomain { validationToken: string } - export interface DomainRegistrationStatusTransfer { status: DomainRegistrationStatusTransferStatus voteCurrentOwner: boolean voteNewOwner: boolean } - export interface Tld { name: string dnssecSupport: boolean @@ -564,7 +502,6 @@ export interface Tld { specifications: Record } - export interface NewContact { legalForm: ContactLegalForm firstname: string @@ -584,7 +521,7 @@ export interface NewContact { lang: StdLanguageCode resale: boolean /** - * @deprecated + * @deprecated */ questions?: ContactQuestion[] extensionFr?: ContactExtensionFR @@ -592,16 +529,13 @@ export interface NewContact { whoisOptIn: boolean state?: string extensionNl?: ContactExtensionNL - extensionIt?: ContactExtensionIT } - export interface CheckContactsCompatibilityResponseContactCheckResult { compatible: boolean errorMessage?: string } - export interface DNSZone { domain: string subdomain: string @@ -615,13 +549,11 @@ export interface DNSZone { linkedProducts: LinkedProduct[] } - export interface DomainDNSSEC { status: DomainFeatureStatus dsRecords: DSRecord[] } - export interface RecordChange { /** * @@ -645,41 +577,34 @@ export interface RecordChange { clear?: RecordChangeClear } - export interface ImportProviderDNSZoneRequestOnlineV1 { token: string } - export interface ImportRawDNSZoneRequestAXFRSource { nameServer: string tsigKey?: ImportRawDNSZoneRequestTsigKey } - export interface ImportRawDNSZoneRequestBindSource { content: string } - export interface ContactRoles { contact?: Contact roles: Record } - export interface Nameserver { name: string ip: string[] } - export interface DNSZoneVersion { id: string createdAt?: Date } - export interface Host { domain: string name: string @@ -687,7 +612,6 @@ export interface Host { status: HostStatus } - export interface DomainSummary { domain: string projectId: string @@ -714,7 +638,6 @@ export interface DomainSummary { pendingTrade: boolean } - export interface InboundTransfer { /** * The unique identifier of the inbound transfer. @@ -750,7 +673,6 @@ export interface InboundTransfer { taskId: string } - export interface RenewableDomain { domain: string projectId: string @@ -764,7 +686,6 @@ export interface RenewableDomain { tld?: Tld } - export interface SSLCertificate { dnsZone: string alternativeDnsZones: string[] @@ -775,7 +696,6 @@ export interface SSLCertificate { expiredAt?: Date } - export interface Task { /** * The unique identifier of the task. @@ -819,26 +739,22 @@ export interface Task { contactIdentifier?: string } - export interface TransferInDomainRequestTransferRequest { domain: string authCode: string } - export interface UpdateContactRequestQuestion { question?: string answer?: string } - export interface AvailableDomain { domain: string available: boolean tld?: Tld } - export interface CheckContactsCompatibilityResponse { compatible: boolean ownerCheckResult?: CheckContactsCompatibilityResponseContactCheckResult @@ -846,7 +762,6 @@ export interface CheckContactsCompatibilityResponse { technicalCheckResult?: CheckContactsCompatibilityResponseContactCheckResult } - export type ClearDNSZoneRecordsRequest = { /** * DNS zone to clear. @@ -854,10 +769,7 @@ export type ClearDNSZoneRecordsRequest = { dnsZone: string } - -export interface ClearDNSZoneRecordsResponse { -} - +export interface ClearDNSZoneRecordsResponse {} export type CloneDNSZoneRequest = { /** @@ -878,7 +790,6 @@ export type CloneDNSZoneRequest = { projectId?: string } - export type CreateDNSZoneRequest = { /** * Domain in which to crreate the DNS zone. @@ -894,13 +805,11 @@ export type CreateDNSZoneRequest = { projectId?: string } - export type CreateSSLCertificateRequest = { dnsZone: string alternativeDnsZones?: string[] } - export type DeleteDNSZoneRequest = { /** * DNS zone to delete. @@ -912,28 +821,19 @@ export type DeleteDNSZoneRequest = { projectId?: string } - -export interface DeleteDNSZoneResponse { -} - +export interface DeleteDNSZoneResponse {} export type DeleteDNSZoneTsigKeyRequest = { dnsZone: string } - -export interface DeleteExternalDomainResponse { -} - +export interface DeleteExternalDomainResponse {} export type DeleteSSLCertificateRequest = { dnsZone: string } - -export interface DeleteSSLCertificateResponse { -} - +export interface DeleteSSLCertificateResponse {} export interface Domain { domain: string @@ -1010,7 +910,6 @@ export interface Domain { pendingTrade: boolean } - export type ExportRawDNSZoneRequest = { /** * DNS zone to export. @@ -1022,39 +921,32 @@ export type ExportRawDNSZoneRequest = { format?: RawFormat } - export type GetDNSZoneTsigKeyRequest = { dnsZone: string } - export interface GetDNSZoneTsigKeyResponse { name: string key: string algorithm: string } - export type GetDNSZoneVersionDiffRequest = { dnsZoneVersionId: string } - export interface GetDNSZoneVersionDiffResponse { changes: RecordChange[] } - export interface GetDomainAuthCodeResponse { authCode: string } - export type GetSSLCertificateRequest = { dnsZone: string } - export type ImportProviderDNSZoneRequest = { dnsZone: string /** @@ -1064,24 +956,22 @@ export type ImportProviderDNSZoneRequest = { onlineV1?: ImportProviderDNSZoneRequestOnlineV1 } - export interface ImportProviderDNSZoneResponse { records: DomainRecord[] } - export type ImportRawDNSZoneRequest = { /** * DNS zone to import. */ dnsZone: string /** - * @deprecated + * @deprecated */ content?: string projectId?: string /** - * @deprecated + * @deprecated */ format?: RawFormat /** @@ -1098,18 +988,15 @@ export type ImportRawDNSZoneRequest = { axfrSource?: ImportRawDNSZoneRequestAXFRSource } - export interface ImportRawDNSZoneResponse { records: DomainRecord[] } - export interface ListContactsResponse { totalCount: number contacts: ContactRoles[] } - export type ListDNSZoneNameserversRequest = { /** * DNS zone on which to filter the returned DNS zone name servers. @@ -1121,7 +1008,6 @@ export type ListDNSZoneNameserversRequest = { projectId?: string } - export interface ListDNSZoneNameserversResponse { /** * DNS zone name servers returned. @@ -1129,7 +1015,6 @@ export interface ListDNSZoneNameserversResponse { ns: Nameserver[] } - export type ListDNSZoneRecordsRequest = { /** * DNS zone on which to filter the returned DNS zone records. @@ -1165,7 +1050,6 @@ export type ListDNSZoneRecordsRequest = { id?: string } - export interface ListDNSZoneRecordsResponse { /** * Total number of DNS zone records. @@ -1177,7 +1061,6 @@ export interface ListDNSZoneRecordsResponse { records: DomainRecord[] } - export type ListDNSZoneVersionRecordsRequest = { dnsZoneVersionId: string /** @@ -1190,7 +1073,6 @@ export type ListDNSZoneVersionRecordsRequest = { pageSize?: number } - export interface ListDNSZoneVersionRecordsResponse { /** * Total number of DNS zones versions records. @@ -1199,7 +1081,6 @@ export interface ListDNSZoneVersionRecordsResponse { records: DomainRecord[] } - export type ListDNSZoneVersionsRequest = { dnsZone: string /** @@ -1212,7 +1093,6 @@ export type ListDNSZoneVersionsRequest = { pageSize?: number } - export interface ListDNSZoneVersionsResponse { /** * Total number of DNS zones versions. @@ -1221,7 +1101,6 @@ export interface ListDNSZoneVersionsResponse { versions: DNSZoneVersion[] } - export type ListDNSZonesRequest = { /** * Organization ID on which to filter the returned DNS zones. @@ -1273,7 +1152,6 @@ export type ListDNSZonesRequest = { updatedBefore?: Date } - export interface ListDNSZonesResponse { /** * Total number of DNS zones matching the requested criteria. @@ -1285,31 +1163,26 @@ export interface ListDNSZonesResponse { dnsZones: DNSZone[] } - export interface ListDomainHostsResponse { totalCount: number hosts: Host[] } - export interface ListDomainsResponse { totalCount: number domains: DomainSummary[] } - export interface ListInboundTransfersResponse { totalCount: number inboundTransfers: InboundTransfer[] } - export interface ListRenewableDomainsResponse { totalCount: number domains: RenewableDomain[] } - export type ListSSLCertificatesRequest = { dnsZone: string page?: number @@ -1317,19 +1190,16 @@ export type ListSSLCertificatesRequest = { projectId?: string } - export interface ListSSLCertificatesResponse { totalCount: number certificates: SSLCertificate[] } - export interface ListTasksResponse { totalCount: number tasks: Task[] } - export interface ListTldsResponse { /** * Array of TLDs. @@ -1341,7 +1211,6 @@ export interface ListTldsResponse { totalCount: number } - export interface OrderResponse { domains: string[] organizationId: string @@ -1350,7 +1219,6 @@ export interface OrderResponse { createdAt?: Date } - export type RefreshDNSZoneRequest = { /** * DNS zone to refresh. @@ -1366,7 +1234,6 @@ export type RefreshDNSZoneRequest = { recreateSubDnsZone: boolean } - export interface RefreshDNSZoneResponse { /** * DNS zones returned. @@ -1374,7 +1241,6 @@ export interface RefreshDNSZoneResponse { dnsZones: DNSZone[] } - export interface RegisterExternalDomainResponse { domain: string organizationId: string @@ -1383,7 +1249,6 @@ export interface RegisterExternalDomainResponse { projectId: string } - export type RegistrarApiBuyDomainsRequest = { domains: string[] durationInYears: number @@ -1420,7 +1285,6 @@ export type RegistrarApiBuyDomainsRequest = { technicalContact?: NewContact } - export type RegistrarApiCheckContactsCompatibilityRequest = { domains?: string[] tlds?: string[] @@ -1456,61 +1320,50 @@ export type RegistrarApiCheckContactsCompatibilityRequest = { technicalContact?: NewContact } - export type RegistrarApiCreateDomainHostRequest = { domain: string name: string ips?: string[] } - export type RegistrarApiDeleteDomainHostRequest = { domain: string name: string } - export type RegistrarApiDeleteExternalDomainRequest = { domain: string } - export type RegistrarApiDisableDomainAutoRenewRequest = { domain: string } - export type RegistrarApiDisableDomainDNSSECRequest = { domain: string } - export type RegistrarApiEnableDomainAutoRenewRequest = { domain: string } - export type RegistrarApiEnableDomainDNSSECRequest = { domain: string dsRecord?: DSRecord } - export type RegistrarApiGetContactRequest = { contactId: string } - export type RegistrarApiGetDomainAuthCodeRequest = { domain: string } - export type RegistrarApiGetDomainRequest = { domain: string } - export type RegistrarApiListContactsRequest = { page?: number pageSize?: number @@ -1521,14 +1374,12 @@ export type RegistrarApiListContactsRequest = { emailStatus?: ContactEmailStatus } - export type RegistrarApiListDomainHostsRequest = { domain: string page?: number pageSize?: number } - export type RegistrarApiListDomainsRequest = { page?: number pageSize?: number @@ -1541,7 +1392,6 @@ export type RegistrarApiListDomainsRequest = { domain?: string } - export type RegistrarApiListInboundTransfersRequest = { page: number pageSize?: number @@ -1550,7 +1400,6 @@ export type RegistrarApiListInboundTransfersRequest = { domain: string } - export type RegistrarApiListRenewableDomainsRequest = { page?: number pageSize?: number @@ -1559,7 +1408,6 @@ export type RegistrarApiListRenewableDomainsRequest = { organizationId?: string } - export type RegistrarApiListTasksRequest = { page?: number pageSize?: number @@ -1571,7 +1419,6 @@ export type RegistrarApiListTasksRequest = { orderBy?: ListTasksRequestOrderBy } - export type RegistrarApiListTldsRequest = { /** * Array of TLDs to return. @@ -1591,25 +1438,21 @@ export type RegistrarApiListTldsRequest = { orderBy?: ListTldsRequestOrderBy } - export type RegistrarApiLockDomainTransferRequest = { domain: string } - export type RegistrarApiRegisterExternalDomainRequest = { domain: string projectId?: string } - export type RegistrarApiRenewDomainsRequest = { domains: string[] durationInYears: number forceLateRenewal?: boolean } - export type RegistrarApiRetryInboundTransferRequest = { /** * The domain being transferred. @@ -1625,7 +1468,6 @@ export type RegistrarApiRetryInboundTransferRequest = { authCode?: string } - export type RegistrarApiSearchAvailableDomainsRequest = { /** * A list of domain to search, TLD is optional. @@ -1641,7 +1483,6 @@ export type RegistrarApiSearchAvailableDomainsRequest = { strictSearch: boolean } - export type RegistrarApiTradeDomainRequest = { domain: string projectId?: string @@ -1657,7 +1498,6 @@ export type RegistrarApiTradeDomainRequest = { newOwnerContact?: NewContact } - export type RegistrarApiTransferInDomainRequest = { domains: TransferInDomainRequestTransferRequest[] projectId?: string @@ -1693,12 +1533,10 @@ export type RegistrarApiTransferInDomainRequest = { technicalContact?: NewContact } - export type RegistrarApiUnlockDomainTransferRequest = { domain: string } - export type RegistrarApiUpdateContactRequest = { contactId: string email?: string @@ -1715,7 +1553,7 @@ export type RegistrarApiUpdateContactRequest = { lang?: StdLanguageCode resale?: boolean /** - * @deprecated + * @deprecated */ questions?: UpdateContactRequestQuestion[] extensionFr?: ContactExtensionFR @@ -1723,17 +1561,14 @@ export type RegistrarApiUpdateContactRequest = { whoisOptIn?: boolean state?: string extensionNl?: ContactExtensionNL - extensionIt?: ContactExtensionIT } - export type RegistrarApiUpdateDomainHostRequest = { domain: string name: string ips?: string[] } - export type RegistrarApiUpdateDomainRequest = { domain: string /** @@ -1747,13 +1582,13 @@ export type RegistrarApiUpdateDomainRequest = { */ technicalContact?: NewContact /** - * @deprecated + * @deprecated * * One-of ('ownerContactInfo'): at most one of 'ownerContactId', 'ownerContact' could be set. */ ownerContactId?: string /** - * @deprecated + * @deprecated * * One-of ('ownerContactInfo'): at most one of 'ownerContactId', 'ownerContact' could be set. */ @@ -1770,25 +1605,13 @@ export type RegistrarApiUpdateDomainRequest = { administrativeContact?: NewContact } - export type RestoreDNSZoneVersionRequest = { dnsZoneVersionId: string } +export interface RestoreDNSZoneVersionResponse {} -export interface RestoreDNSZoneVersionResponse { -} - - -export interface RetryInboundTransferResponse { -} - - -export interface SearchAvailableDomainsConsoleResponse { - exactMatchDomain?: AvailableDomain - availableDomains: AvailableDomain[] -} - +export interface RetryInboundTransferResponse {} export interface SearchAvailableDomainsResponse { /** @@ -1797,14 +1620,6 @@ export interface SearchAvailableDomainsResponse { availableDomains: AvailableDomain[] } - -export type UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest = { - domain: string - tlds?: string[] - strictSearch: boolean -} - - export type UpdateDNSZoneNameserversRequest = { /** * DNS zone in which to update the DNS zone name servers. @@ -1816,7 +1631,6 @@ export type UpdateDNSZoneNameserversRequest = { ns: Nameserver[] } - export interface UpdateDNSZoneNameserversResponse { /** * DNS zone name servers returned. @@ -1824,7 +1638,6 @@ export interface UpdateDNSZoneNameserversResponse { ns: Nameserver[] } - export type UpdateDNSZoneRecordsRequest = { /** * DNS zone in which to update the DNS zone records. @@ -1848,7 +1661,6 @@ export type UpdateDNSZoneRecordsRequest = { serial?: number } - export interface UpdateDNSZoneRecordsResponse { /** * DNS zone records returned. @@ -1856,7 +1668,6 @@ export interface UpdateDNSZoneRecordsResponse { records: DomainRecord[] } - export type UpdateDNSZoneRequest = { /** * DNS zone to update. @@ -1871,5 +1682,3 @@ export type UpdateDNSZoneRequest = { */ projectId?: string } - - diff --git a/packages_generated/edge_services/src/v1beta1/api.gen.ts b/packages_generated/edge_services/src/v1beta1/api.gen.ts index b3427f607..b1695734c 100644 --- a/packages_generated/edge_services/src/v1beta1/api.gen.ts +++ b/packages_generated/edge_services/src/v1beta1/api.gen.ts @@ -7,8 +7,11 @@ import { validatePathParam, waitForResource, } from '@scaleway/sdk-client' -import type { WaitForOptions, } from '@scaleway/sdk-client' -import {PIPELINE_TRANSIENT_STATUSES as PIPELINE_TRANSIENT_STATUSES_EDGE_SERVICES,PURGE_REQUEST_TRANSIENT_STATUSES as PURGE_REQUEST_TRANSIENT_STATUSES_EDGE_SERVICES,} from './content.gen.js' +import type { WaitForOptions } from '@scaleway/sdk-client' +import { + PIPELINE_TRANSIENT_STATUSES as PIPELINE_TRANSIENT_STATUSES_EDGE_SERVICES, + PURGE_REQUEST_TRANSIENT_STATUSES as PURGE_REQUEST_TRANSIENT_STATUSES_EDGE_SERVICES, +} from './content.gen.js' import { marshalAddRouteRulesRequest, unmarshalAddRouteRulesResponse, @@ -154,7 +157,9 @@ const jsonContentHeaders = { * Edge Services API. */ export class API extends ParentAPI { - protected pageOfListPipelines = (request: Readonly = {}) => + protected pageOfListPipelines = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -165,13 +170,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListPipelinesResponse, ) - + /** * List pipelines. List all pipelines, for a Scaleway Organization or Scaleway Project. By default, the pipelines returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -181,7 +189,6 @@ export class API extends ParentAPI { listPipelines = (request: Readonly = {}) => enrichForPagination('pipelines', this.pageOfListPipelines, request) - /** * Create pipeline. Create a new pipeline. You must specify a `dns_stage_id` to form a stage-chain that goes all the way to the backend stage (origin), so the HTTP request will be processed according to the stages you created. * @@ -201,7 +208,6 @@ export class API extends ParentAPI { unmarshalPipeline, ) - /** * Get pipeline. Retrieve information about an existing pipeline, specified by its `pipeline_id`. Its full details, including errors, are returned in the response object. * @@ -216,7 +222,7 @@ export class API extends ParentAPI { }, unmarshalPipeline, ) - + /** * Waits for {@link Pipeline} to be in a final state. * @@ -229,14 +235,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!PIPELINE_TRANSIENT_STATUSES_EDGE_SERVICES.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !PIPELINE_TRANSIENT_STATUSES_EDGE_SERVICES.includes(res.status), + )), this.getPipeline, request, options, ) - - protected pageOfListPipelinesWithStages = (request: Readonly = {}) => + protected pageOfListPipelinesWithStages = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -246,17 +257,25 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListPipelinesWithStagesResponse, ) - - listPipelinesWithStages = (request: Readonly = {}) => - enrichForPagination('pipelines', this.pageOfListPipelinesWithStages, request) - + listPipelinesWithStages = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'pipelines', + this.pageOfListPipelinesWithStages, + request, + ) + /** * Update pipeline. Update the parameters of an existing pipeline, specified by its `pipeline_id`. Parameters which can be updated include the `name`, `description` and `dns_stage_id`. * @@ -276,21 +295,17 @@ export class API extends ParentAPI { unmarshalPipeline, ) - /** * Delete pipeline. Delete an existing pipeline, specified by its `pipeline_id`. Deleting a pipeline is permanent, and cannot be undone. Note that all stages linked to the pipeline are also deleted. * * @param request - The request {@link DeletePipelineRequest} */ deletePipeline = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/pipelines/${validatePathParam('pipelineId', request.pipelineId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/pipelines/${validatePathParam('pipelineId', request.pipelineId)}`, + }) - protected pageOfListHeadStages = (request: Readonly) => this.client.fetch( { @@ -298,16 +313,18 @@ export class API extends ParentAPI { path: `/edge-services/v1beta1/pipelines/${validatePathParam('pipelineId', request.pipelineId)}/head-stages`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListHeadStagesResponse, ) - + listHeadStages = (request: Readonly) => enrichForPagination('headStages', this.pageOfListHeadStages, request) - /** * Configure a entry point to your pipeline. You must specify a `head stage` to form a stage-chain that goes all the way to the backend stage (origin), so the HTTP request will be processed according to the stages you created.. You must specify either a `add_new_head_stage` (to add a new head stage), `remove_head_stage` (to remove a head stage) or `swap_head_stage` (to replace a head stage). * @@ -327,7 +344,6 @@ export class API extends ParentAPI { unmarshalHeadStageResponse, ) - protected pageOfListDNSStages = (request: Readonly) => this.client.fetch( { @@ -337,12 +353,15 @@ export class API extends ParentAPI { ['fqdn', request.fqdn], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDNSStagesResponse, ) - + /** * List DNS stages. List all DNS stages, for a Scaleway Organization or Scaleway Project. By default, the DNS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -352,7 +371,6 @@ export class API extends ParentAPI { listDNSStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListDNSStages, request) - /** * Create DNS stage. Create a new DNS stage. You must specify the `fqdns` field to customize the domain endpoint, using a domain you already own. * @@ -372,7 +390,6 @@ export class API extends ParentAPI { unmarshalDNSStage, ) - /** * Get DNS stage. Retrieve information about an existing DNS stage, specified by its `dns_stage_id`. Its full details, including FQDNs, are returned in the response object. * @@ -388,7 +405,6 @@ export class API extends ParentAPI { unmarshalDNSStage, ) - /** * Update DNS stage. Update the parameters of an existing DNS stage, specified by its `dns_stage_id`. * @@ -408,21 +424,17 @@ export class API extends ParentAPI { unmarshalDNSStage, ) - /** * Delete DNS stage. Delete an existing DNS stage, specified by its `dns_stage_id`. Deleting a DNS stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteDNSStageRequest} */ deleteDNSStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/dns-stages/${validatePathParam('dnsStageId', request.dnsStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/dns-stages/${validatePathParam('dnsStageId', request.dnsStageId)}`, + }) - protected pageOfListTLSStages = (request: Readonly) => this.client.fetch( { @@ -431,14 +443,17 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['secret_id', request.secretId], ['secret_region', request.secretRegion], ), }, unmarshalListTLSStagesResponse, ) - + /** * List TLS stages. List all TLS stages, for a Scaleway Organization or Scaleway Project. By default, the TLS stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -448,7 +463,6 @@ export class API extends ParentAPI { listTLSStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListTLSStages, request) - /** * Create TLS stage. Create a new TLS stage. You must specify either the `secrets` or `managed_certificate` fields to customize the SSL/TLS certificate of your endpoint. Choose `secrets` if you are using a pre-existing certificate held in Scaleway Secret Manager, or `managed_certificate` to let Scaleway generate and manage a Let's Encrypt certificate for your customized endpoint. * @@ -468,7 +482,6 @@ export class API extends ParentAPI { unmarshalTLSStage, ) - /** * Get TLS stage. Retrieve information about an existing TLS stage, specified by its `tls_stage_id`. Its full details, including secrets and certificate expiration date are returned in the response object. * @@ -484,7 +497,6 @@ export class API extends ParentAPI { unmarshalTLSStage, ) - /** * Update TLS stage. Update the parameters of an existing TLS stage, specified by its `tls_stage_id`. Both `tls_secrets_config` and `managed_certificate` parameters can be updated. * @@ -504,22 +516,20 @@ export class API extends ParentAPI { unmarshalTLSStage, ) - /** * Delete TLS stage. Delete an existing TLS stage, specified by its `tls_stage_id`. Deleting a TLS stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteTLSStageRequest} */ deleteTLSStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/tls-stages/${validatePathParam('tlsStageId', request.tlsStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/tls-stages/${validatePathParam('tlsStageId', request.tlsStageId)}`, + }) - - protected pageOfListCacheStages = (request: Readonly) => + protected pageOfListCacheStages = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -527,12 +537,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCacheStagesResponse, ) - + /** * List cache stages. List all cache stages, for a Scaleway Organization or Scaleway Project. By default, the cache stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -542,7 +555,6 @@ export class API extends ParentAPI { listCacheStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListCacheStages, request) - /** * Create cache stage. Create a new cache stage. You must specify the `fallback_ttl` field to customize the TTL of the cache. * @@ -562,7 +574,6 @@ export class API extends ParentAPI { unmarshalCacheStage, ) - /** * Get cache stage. Retrieve information about an existing cache stage, specified by its `cache_stage_id`. Its full details, including Time To Live (TTL), are returned in the response object. * @@ -578,7 +589,6 @@ export class API extends ParentAPI { unmarshalCacheStage, ) - /** * Update cache stage. Update the parameters of an existing cache stage, specified by its `cache_stage_id`. Parameters which can be updated include the `fallback_ttl`, `include_cookies` and `backend_stage_id`. * @@ -598,22 +608,20 @@ export class API extends ParentAPI { unmarshalCacheStage, ) - /** * Delete cache stage. Delete an existing cache stage, specified by its `cache_stage_id`. Deleting a cache stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteCacheStageRequest} */ deleteCacheStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/cache-stages/${validatePathParam('cacheStageId', request.cacheStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/cache-stages/${validatePathParam('cacheStageId', request.cacheStageId)}`, + }) - - protected pageOfListBackendStages = (request: Readonly) => + protected pageOfListBackendStages = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -624,12 +632,15 @@ export class API extends ParentAPI { ['lb_id', request.lbId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackendStagesResponse, ) - + /** * List backend stages. List all backend stages, for a Scaleway Organization or Scaleway Project. By default, the backend stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -639,7 +650,6 @@ export class API extends ParentAPI { listBackendStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListBackendStages, request) - /** * Create backend stage. Create a new backend stage. You must specify either a `scaleway_s3` (for a Scaleway Object Storage bucket) or `scaleway_lb` (for a Scaleway Load Balancer) field to configure the origin. * @@ -659,7 +669,6 @@ export class API extends ParentAPI { unmarshalBackendStage, ) - /** * Get backend stage. Retrieve information about an existing backend stage, specified by its `backend_stage_id`. Its full details, including `scaleway_s3` or `scaleway_lb`, are returned in the response object. * @@ -675,7 +684,6 @@ export class API extends ParentAPI { unmarshalBackendStage, ) - /** * Update backend stage. Update the parameters of an existing backend stage, specified by its `backend_stage_id`. * @@ -695,21 +703,17 @@ export class API extends ParentAPI { unmarshalBackendStage, ) - /** * Delete backend stage. Delete an existing backend stage, specified by its `backend_stage_id`. Deleting a backend stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteBackendStageRequest} */ deleteBackendStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/backend-stages/${validatePathParam('backendStageId', request.backendStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/backend-stages/${validatePathParam('backendStageId', request.backendStageId)}`, + }) - searchBackendStages = (request: Readonly = {}) => this.client.fetch( { @@ -721,14 +725,19 @@ export class API extends ParentAPI { ['lb_id', request.lbId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListBackendStagesResponse, ) - protected pageOfListWafStages = (request: Readonly) => this.client.fetch( { @@ -737,12 +746,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListWafStagesResponse, ) - + /** * List WAF stages. List all WAF stages, for a Scaleway Organization or Scaleway Project. By default, the WAF stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -752,7 +764,6 @@ export class API extends ParentAPI { listWafStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListWafStages, request) - /** * Create WAF stage. Create a new WAF stage. You must specify the `mode` and `paranoia_level` fields to customize the WAF. * @@ -772,7 +783,6 @@ export class API extends ParentAPI { unmarshalWafStage, ) - /** * Get WAF stage. Retrieve information about an existing WAF stage, specified by its `waf_stage_id`. Its full details are returned in the response object. * @@ -788,7 +798,6 @@ export class API extends ParentAPI { unmarshalWafStage, ) - /** * Update WAF stage. Update the parameters of an existing WAF stage, specified by its `waf_stage_id`. Both `mode` and `paranoia_level` parameters can be updated. * @@ -808,21 +817,17 @@ export class API extends ParentAPI { unmarshalWafStage, ) - /** * Delete WAF stage. Delete an existing WAF stage, specified by its `waf_stage_id`. Deleting a WAF stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteWafStageRequest} */ deleteWafStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/waf-stages/${validatePathParam('wafStageId', request.wafStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/waf-stages/${validatePathParam('wafStageId', request.wafStageId)}`, + }) - searchWafStages = (request: Readonly = {}) => this.client.fetch( { @@ -831,15 +836,22 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListWafStagesResponse, ) - - protected pageOfListRouteStages = (request: Readonly) => + protected pageOfListRouteStages = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -847,12 +859,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListRouteStagesResponse, ) - + /** * List route stages. List all route stages, for a given pipeline. By default, the route stages returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -862,7 +877,6 @@ export class API extends ParentAPI { listRouteStages = (request: Readonly) => enrichForPagination('stages', this.pageOfListRouteStages, request) - /** * Create route stage. Create a new route stage. You must specify the `waf_stage_id` field to customize the route. * @@ -882,7 +896,6 @@ export class API extends ParentAPI { unmarshalRouteStage, ) - /** * Get route stage. Retrieve information about an existing route stage, specified by its `route_stage_id`. The summary of the route stage (without route rules) is returned in the response object. * @@ -898,7 +911,6 @@ export class API extends ParentAPI { unmarshalRouteStage, ) - /** * Update route stage. Update the parameters of an existing route stage, specified by its `route_stage_id`. * @@ -918,21 +930,17 @@ export class API extends ParentAPI { unmarshalRouteStage, ) - /** * Delete route stage. Delete an existing route stage, specified by its `route_stage_id`. Deleting a route stage is permanent, and cannot be undone. * * @param request - The request {@link DeleteRouteStageRequest} */ deleteRouteStage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/route-stages/${validatePathParam('routeStageId', request.routeStageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/route-stages/${validatePathParam('routeStageId', request.routeStageId)}`, + }) - /** * List route rules. List all route rules of an existing route stage, specified by its `route_stage_id`. * @@ -948,7 +956,6 @@ export class API extends ParentAPI { unmarshalListRouteRulesResponse, ) - /** * Set route rules. Set the rules of an existing route stage, specified by its `route_stage_id`. * @@ -968,7 +975,6 @@ export class API extends ParentAPI { unmarshalSetRouteRulesResponse, ) - /** * Add route rules. Add route rules to an existing route stage, specified by its `route_stage_id`. * @@ -988,7 +994,6 @@ export class API extends ParentAPI { unmarshalAddRouteRulesResponse, ) - /** * List route rules. List all route rules of an organization or project. * @@ -1004,14 +1009,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListRouteRulesResponse, ) - checkDomain = (request: Readonly) => this.client.fetch( { @@ -1025,7 +1032,6 @@ export class API extends ParentAPI { unmarshalCheckDomainResponse, ) - checkPEMChain = (request: Readonly) => this.client.fetch( { @@ -1039,8 +1045,9 @@ export class API extends ParentAPI { unmarshalCheckPEMChainResponse, ) - - protected pageOfListPurgeRequests = (request: Readonly = {}) => + protected pageOfListPurgeRequests = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1049,14 +1056,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['pipeline_id', request.pipelineId], ['project_id', request.projectId], ), }, unmarshalListPurgeRequestsResponse, ) - + /** * List purge requests. List all purge requests, for a Scaleway Organization or Scaleway Project. This enables you to retrieve a history of all previously-made purge requests. By default, the purge requests returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -1066,7 +1076,6 @@ export class API extends ParentAPI { listPurgeRequests = (request: Readonly = {}) => enrichForPagination('purgeRequests', this.pageOfListPurgeRequests, request) - /** * Create purge request. Create a new purge request. You must specify either the `all` field (to purge all content) or a list of `assets` (to define the precise assets to purge). * @@ -1086,7 +1095,6 @@ export class API extends ParentAPI { unmarshalPurgeRequest, ) - /** * Get purge request. Retrieve information about a purge request, specified by its `purge_request_id`. Its full details, including `status` and `target`, are returned in the response object. * @@ -1101,7 +1109,7 @@ export class API extends ParentAPI { }, unmarshalPurgeRequest, ) - + /** * Waits for {@link PurgeRequest} to be in a final state. * @@ -1114,13 +1122,18 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!PURGE_REQUEST_TRANSIENT_STATUSES_EDGE_SERVICES.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !PURGE_REQUEST_TRANSIENT_STATUSES_EDGE_SERVICES.includes( + res.status, + ), + )), this.getPurgeRequest, request, options, ) - checkLbOrigin = (request: Readonly = {}) => this.client.fetch( { @@ -1134,7 +1147,6 @@ export class API extends ParentAPI { unmarshalCheckLbOriginResponse, ) - listPlans = () => this.client.fetch( { @@ -1144,7 +1156,6 @@ export class API extends ParentAPI { unmarshalListPlansResponse, ) - selectPlan = (request: Readonly = {}) => this.client.fetch( { @@ -1158,7 +1169,6 @@ export class API extends ParentAPI { unmarshalPlan, ) - getCurrentPlan = (request: Readonly = {}) => this.client.fetch( { @@ -1168,16 +1178,12 @@ export class API extends ParentAPI { unmarshalPlan, ) - deleteCurrentPlan = (request: Readonly = {}) => - this.client.fetch( - { - method: 'DELETE', - path: `/edge-services/v1beta1/current-plan/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/edge-services/v1beta1/current-plan/${validatePathParam('projectId', request.projectId ?? this.client.settings.defaultProjectId)}`, + }) - /** * Gives information on the currently selected Edge Services subscription plan, resource usage and associated billing information for this calendar month (including whether consumption falls within or exceeds the currently selected subscription plan.). * @@ -1192,7 +1198,4 @@ export class API extends ParentAPI { }, unmarshalGetBillingResponse, ) - - } - diff --git a/packages_generated/edge_services/src/v1beta1/content.gen.ts b/packages_generated/edge_services/src/v1beta1/content.gen.ts index 9cf6c66e5..79f1155ec 100644 --- a/packages_generated/edge_services/src/v1beta1/content.gen.ts +++ b/packages_generated/edge_services/src/v1beta1/content.gen.ts @@ -1,18 +1,11 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - PipelineStatus, - PurgeRequestStatus, -} from './types.gen.js' - +import type { PipelineStatus, PurgeRequestStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link PipelineStatus}. */ -export const PIPELINE_TRANSIENT_STATUSES: PipelineStatus[] = [ - 'pending', -] +export const PIPELINE_TRANSIENT_STATUSES: PipelineStatus[] = ['pending'] /** Lists transient statutes of the enum {@link PurgeRequestStatus}. */ export const PURGE_REQUEST_TRANSIENT_STATUSES: PurgeRequestStatus[] = [ 'pending', ] - diff --git a/packages_generated/edge_services/src/v1beta1/index.gen.ts b/packages_generated/edge_services/src/v1beta1/index.gen.ts index 5b7072f17..198f23747 100644 --- a/packages_generated/edge_services/src/v1beta1/index.gen.ts +++ b/packages_generated/edge_services/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/edge_services/src/v1beta1/marshalling.gen.ts b/packages_generated/edge_services/src/v1beta1/marshalling.gen.ts index 52b4839df..22bcbdd59 100644 --- a/packages_generated/edge_services/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/edge_services/src/v1beta1/marshalling.gen.ts @@ -1,5 +1,11 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMapOfObject, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ScalewayLb, @@ -91,7 +97,9 @@ const unmarshalScalewayLb = (data: unknown): ScalewayLb => { } as ScalewayLb } -const unmarshalScalewayLbBackendConfig = (data: unknown): ScalewayLbBackendConfig => { +const unmarshalScalewayLbBackendConfig = ( + data: unknown, +): ScalewayLbBackendConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ScalewayLbBackendConfig' failed as data isn't a dictionary.`, @@ -103,7 +111,9 @@ const unmarshalScalewayLbBackendConfig = (data: unknown): ScalewayLbBackendConfi } as ScalewayLbBackendConfig } -const unmarshalScalewayS3BackendConfig = (data: unknown): ScalewayS3BackendConfig => { +const unmarshalScalewayS3BackendConfig = ( + data: unknown, +): ScalewayS3BackendConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ScalewayS3BackendConfig' failed as data isn't a dictionary.`, @@ -117,7 +127,9 @@ const unmarshalScalewayS3BackendConfig = (data: unknown): ScalewayS3BackendConfi } as ScalewayS3BackendConfig } -const unmarshalScalewayServerlessContainerBackendConfig = (data: unknown): ScalewayServerlessContainerBackendConfig => { +const unmarshalScalewayServerlessContainerBackendConfig = ( + data: unknown, +): ScalewayServerlessContainerBackendConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ScalewayServerlessContainerBackendConfig' failed as data isn't a dictionary.`, @@ -141,9 +153,17 @@ export const unmarshalBackendStage = (data: unknown): BackendStage => { createdAt: unmarshalDate(data.created_at), id: data.id, pipelineId: data.pipeline_id, - scalewayLb: data.scaleway_lb ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) : undefined, - scalewayS3: data.scaleway_s3 ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) : undefined, - scalewayServerlessContainer: data.scaleway_serverless_container ? unmarshalScalewayServerlessContainerBackendConfig(data.scaleway_serverless_container) : undefined, + scalewayLb: data.scaleway_lb + ? unmarshalScalewayLbBackendConfig(data.scaleway_lb) + : undefined, + scalewayS3: data.scaleway_s3 + ? unmarshalScalewayS3BackendConfig(data.scaleway_s3) + : undefined, + scalewayServerlessContainer: data.scaleway_serverless_container + ? unmarshalScalewayServerlessContainerBackendConfig( + data.scaleway_serverless_container, + ) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as BackendStage } @@ -302,7 +322,10 @@ export const unmarshalPipelineStages = (data: unknown): PipelineStages => { } return { - backendStages: unmarshalArrayOfObject(data.backend_stages, unmarshalBackendStage), + backendStages: unmarshalArrayOfObject( + data.backend_stages, + unmarshalBackendStage, + ), cacheStages: unmarshalArrayOfObject(data.cache_stages, unmarshalCacheStage), dnsStages: unmarshalArrayOfObject(data.dns_stages, unmarshalDNSStage), pipeline: data.pipeline ? unmarshalPipeline(data.pipeline) : undefined, @@ -330,7 +353,9 @@ export const unmarshalPurgeRequest = (data: unknown): PurgeRequest => { } as PurgeRequest } -const unmarshalRuleHttpMatchPathFilter = (data: unknown): RuleHttpMatchPathFilter => { +const unmarshalRuleHttpMatchPathFilter = ( + data: unknown, +): RuleHttpMatchPathFilter => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RuleHttpMatchPathFilter' failed as data isn't a dictionary.`, @@ -352,7 +377,9 @@ const unmarshalRuleHttpMatch = (data: unknown): RuleHttpMatch => { return { methodFilters: data.method_filters, - pathFilter: data.path_filter ? unmarshalRuleHttpMatchPathFilter(data.path_filter) : undefined, + pathFilter: data.path_filter + ? unmarshalRuleHttpMatchPathFilter(data.path_filter) + : undefined, } as RuleHttpMatch } @@ -367,11 +394,15 @@ const unmarshalRouteRule = (data: unknown): RouteRule => { backendStageId: data.backend_stage_id, position: data.position, routeStageId: data.route_stage_id, - ruleHttpMatch: data.rule_http_match ? unmarshalRuleHttpMatch(data.rule_http_match) : undefined, + ruleHttpMatch: data.rule_http_match + ? unmarshalRuleHttpMatch(data.rule_http_match) + : undefined, } as RouteRule } -export const unmarshalAddRouteRulesResponse = (data: unknown): AddRouteRulesResponse => { +export const unmarshalAddRouteRulesResponse = ( + data: unknown, +): AddRouteRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddRouteRulesResponse' failed as data isn't a dictionary.`, @@ -383,7 +414,9 @@ export const unmarshalAddRouteRulesResponse = (data: unknown): AddRouteRulesResp } as AddRouteRulesResponse } -export const unmarshalCheckDomainResponse = (data: unknown): CheckDomainResponse => { +export const unmarshalCheckDomainResponse = ( + data: unknown, +): CheckDomainResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckDomainResponse' failed as data isn't a dictionary.`, @@ -395,7 +428,9 @@ export const unmarshalCheckDomainResponse = (data: unknown): CheckDomainResponse } as CheckDomainResponse } -export const unmarshalCheckLbOriginResponse = (data: unknown): CheckLbOriginResponse => { +export const unmarshalCheckLbOriginResponse = ( + data: unknown, +): CheckLbOriginResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckLbOriginResponse' failed as data isn't a dictionary.`, @@ -408,7 +443,9 @@ export const unmarshalCheckLbOriginResponse = (data: unknown): CheckLbOriginResp } as CheckLbOriginResponse } -export const unmarshalCheckPEMChainResponse = (data: unknown): CheckPEMChainResponse => { +export const unmarshalCheckPEMChainResponse = ( + data: unknown, +): CheckPEMChainResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckPEMChainResponse' failed as data isn't a dictionary.`, @@ -447,7 +484,9 @@ const unmarshalPlanUsageDetails = (data: unknown): PlanUsageDetails => { } as PlanUsageDetails } -export const unmarshalGetBillingResponse = (data: unknown): GetBillingResponse => { +export const unmarshalGetBillingResponse = ( + data: unknown, +): GetBillingResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetBillingResponse' failed as data isn't a dictionary.`, @@ -455,23 +494,36 @@ export const unmarshalGetBillingResponse = (data: unknown): GetBillingResponse = } return { - currentPlan: data.current_plan ? unmarshalPlanDetails(data.current_plan) : undefined, + currentPlan: data.current_plan + ? unmarshalPlanDetails(data.current_plan) + : undefined, currentPlanCacheUsage: data.current_plan_cache_usage, currentPlanWafUsage: data.current_plan_waf_usage, - extraCacheCost: data.extra_cache_cost ? unmarshalMoney(data.extra_cache_cost) : undefined, + extraCacheCost: data.extra_cache_cost + ? unmarshalMoney(data.extra_cache_cost) + : undefined, extraCacheUsage: data.extra_cache_usage, - extraPipelinesCost: data.extra_pipelines_cost ? unmarshalMoney(data.extra_pipelines_cost) : undefined, - extraWafCost: data.extra_waf_cost ? unmarshalMoney(data.extra_waf_cost) : undefined, + extraPipelinesCost: data.extra_pipelines_cost + ? unmarshalMoney(data.extra_pipelines_cost) + : undefined, + extraWafCost: data.extra_waf_cost + ? unmarshalMoney(data.extra_waf_cost) + : undefined, extraWafUsage: data.extra_waf_usage, pipelineNumber: data.pipeline_number, planCost: data.plan_cost ? unmarshalMoney(data.plan_cost) : undefined, - plansUsageDetails: unmarshalMapOfObject(data.plans_usage_details, unmarshalPlanUsageDetails), + plansUsageDetails: unmarshalMapOfObject( + data.plans_usage_details, + unmarshalPlanUsageDetails, + ), totalCost: data.total_cost ? unmarshalMoney(data.total_cost) : undefined, wafAddOn: data.waf_add_on ? unmarshalMoney(data.waf_add_on) : undefined, } as GetBillingResponse } -const unmarshalHeadStageResponseHeadStage = (data: unknown): HeadStageResponseHeadStage => { +const unmarshalHeadStageResponseHeadStage = ( + data: unknown, +): HeadStageResponseHeadStage => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HeadStageResponseHeadStage' failed as data isn't a dictionary.`, @@ -483,7 +535,9 @@ const unmarshalHeadStageResponseHeadStage = (data: unknown): HeadStageResponseHe } as HeadStageResponseHeadStage } -export const unmarshalHeadStageResponse = (data: unknown): HeadStageResponse => { +export const unmarshalHeadStageResponse = ( + data: unknown, +): HeadStageResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HeadStageResponse' failed as data isn't a dictionary.`, @@ -491,11 +545,15 @@ export const unmarshalHeadStageResponse = (data: unknown): HeadStageResponse => } return { - headStage: data.head_stage ? unmarshalHeadStageResponseHeadStage(data.head_stage) : undefined, + headStage: data.head_stage + ? unmarshalHeadStageResponseHeadStage(data.head_stage) + : undefined, } as HeadStageResponse } -export const unmarshalListBackendStagesResponse = (data: unknown): ListBackendStagesResponse => { +export const unmarshalListBackendStagesResponse = ( + data: unknown, +): ListBackendStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBackendStagesResponse' failed as data isn't a dictionary.`, @@ -508,7 +566,9 @@ export const unmarshalListBackendStagesResponse = (data: unknown): ListBackendSt } as ListBackendStagesResponse } -export const unmarshalListCacheStagesResponse = (data: unknown): ListCacheStagesResponse => { +export const unmarshalListCacheStagesResponse = ( + data: unknown, +): ListCacheStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCacheStagesResponse' failed as data isn't a dictionary.`, @@ -521,7 +581,9 @@ export const unmarshalListCacheStagesResponse = (data: unknown): ListCacheStages } as ListCacheStagesResponse } -export const unmarshalListDNSStagesResponse = (data: unknown): ListDNSStagesResponse => { +export const unmarshalListDNSStagesResponse = ( + data: unknown, +): ListDNSStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDNSStagesResponse' failed as data isn't a dictionary.`, @@ -534,7 +596,9 @@ export const unmarshalListDNSStagesResponse = (data: unknown): ListDNSStagesResp } as ListDNSStagesResponse } -const unmarshalListHeadStagesResponseHeadStage = (data: unknown): ListHeadStagesResponseHeadStage => { +const unmarshalListHeadStagesResponseHeadStage = ( + data: unknown, +): ListHeadStagesResponseHeadStage => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListHeadStagesResponseHeadStage' failed as data isn't a dictionary.`, @@ -546,7 +610,9 @@ const unmarshalListHeadStagesResponseHeadStage = (data: unknown): ListHeadStages } as ListHeadStagesResponseHeadStage } -export const unmarshalListHeadStagesResponse = (data: unknown): ListHeadStagesResponse => { +export const unmarshalListHeadStagesResponse = ( + data: unknown, +): ListHeadStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListHeadStagesResponse' failed as data isn't a dictionary.`, @@ -554,12 +620,17 @@ export const unmarshalListHeadStagesResponse = (data: unknown): ListHeadStagesRe } return { - headStages: unmarshalArrayOfObject(data.head_stages, unmarshalListHeadStagesResponseHeadStage), + headStages: unmarshalArrayOfObject( + data.head_stages, + unmarshalListHeadStagesResponseHeadStage, + ), totalCount: data.total_count, } as ListHeadStagesResponse } -export const unmarshalListPipelinesResponse = (data: unknown): ListPipelinesResponse => { +export const unmarshalListPipelinesResponse = ( + data: unknown, +): ListPipelinesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPipelinesResponse' failed as data isn't a dictionary.`, @@ -572,7 +643,9 @@ export const unmarshalListPipelinesResponse = (data: unknown): ListPipelinesResp } as ListPipelinesResponse } -export const unmarshalListPipelinesWithStagesResponse = (data: unknown): ListPipelinesWithStagesResponse => { +export const unmarshalListPipelinesWithStagesResponse = ( + data: unknown, +): ListPipelinesWithStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPipelinesWithStagesResponse' failed as data isn't a dictionary.`, @@ -585,7 +658,9 @@ export const unmarshalListPipelinesWithStagesResponse = (data: unknown): ListPip } as ListPipelinesWithStagesResponse } -export const unmarshalListPlansResponse = (data: unknown): ListPlansResponse => { +export const unmarshalListPlansResponse = ( + data: unknown, +): ListPlansResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPlansResponse' failed as data isn't a dictionary.`, @@ -598,7 +673,9 @@ export const unmarshalListPlansResponse = (data: unknown): ListPlansResponse => } as ListPlansResponse } -export const unmarshalListPurgeRequestsResponse = (data: unknown): ListPurgeRequestsResponse => { +export const unmarshalListPurgeRequestsResponse = ( + data: unknown, +): ListPurgeRequestsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPurgeRequestsResponse' failed as data isn't a dictionary.`, @@ -606,12 +683,17 @@ export const unmarshalListPurgeRequestsResponse = (data: unknown): ListPurgeRequ } return { - purgeRequests: unmarshalArrayOfObject(data.purge_requests, unmarshalPurgeRequest), + purgeRequests: unmarshalArrayOfObject( + data.purge_requests, + unmarshalPurgeRequest, + ), totalCount: data.total_count, } as ListPurgeRequestsResponse } -export const unmarshalListRouteRulesResponse = (data: unknown): ListRouteRulesResponse => { +export const unmarshalListRouteRulesResponse = ( + data: unknown, +): ListRouteRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRouteRulesResponse' failed as data isn't a dictionary.`, @@ -624,7 +706,9 @@ export const unmarshalListRouteRulesResponse = (data: unknown): ListRouteRulesRe } as ListRouteRulesResponse } -export const unmarshalListRouteStagesResponse = (data: unknown): ListRouteStagesResponse => { +export const unmarshalListRouteStagesResponse = ( + data: unknown, +): ListRouteStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRouteStagesResponse' failed as data isn't a dictionary.`, @@ -637,7 +721,9 @@ export const unmarshalListRouteStagesResponse = (data: unknown): ListRouteStages } as ListRouteStagesResponse } -export const unmarshalListTLSStagesResponse = (data: unknown): ListTLSStagesResponse => { +export const unmarshalListTLSStagesResponse = ( + data: unknown, +): ListTLSStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTLSStagesResponse' failed as data isn't a dictionary.`, @@ -650,7 +736,9 @@ export const unmarshalListTLSStagesResponse = (data: unknown): ListTLSStagesResp } as ListTLSStagesResponse } -export const unmarshalListWafStagesResponse = (data: unknown): ListWafStagesResponse => { +export const unmarshalListWafStagesResponse = ( + data: unknown, +): ListWafStagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListWafStagesResponse' failed as data isn't a dictionary.`, @@ -675,7 +763,9 @@ export const unmarshalPlan = (data: unknown): Plan => { } as Plan } -export const unmarshalSetRouteRulesResponse = (data: unknown): SetRouteRulesResponse => { +export const unmarshalSetRouteRulesResponse = ( + data: unknown, +): SetRouteRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetRouteRulesResponse' failed as data isn't a dictionary.`, @@ -699,24 +789,28 @@ const marshalRuleHttpMatch = ( request: RuleHttpMatch, defaults: DefaultValues, ): Record => ({ - method_filters: request.methodFilters, - path_filter: ((request.pathFilter !== undefined) ? marshalRuleHttpMatchPathFilter(request.pathFilter, defaults): undefined), + method_filters: request.methodFilters, + path_filter: + request.pathFilter !== undefined + ? marshalRuleHttpMatchPathFilter(request.pathFilter, defaults) + : undefined, }) export const marshalSetRouteRulesRequestRouteRule = ( request: SetRouteRulesRequestRouteRule, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'rule_http_match', - value: (request.ruleHttpMatch !== undefined) ? marshalRuleHttpMatch(request.ruleHttpMatch, defaults) - : undefined, + { + param: 'rule_http_match', + value: + request.ruleHttpMatch !== undefined + ? marshalRuleHttpMatch(request.ruleHttpMatch, defaults) + : undefined, }, - ]), + ]), ...resolveOneOf([ - {param: 'backend_stage_id', - value: request.backendStageId, - }, + { param: 'backend_stage_id', value: request.backendStageId }, ]), }) @@ -724,14 +818,15 @@ export const marshalAddRouteRulesRequest = ( request: AddRouteRulesRequest, defaults: DefaultValues, ): Record => ({ - route_rules: ((request.routeRules !== undefined) ? request.routeRules.map(elt => marshalSetRouteRulesRequestRouteRule(elt, defaults)): undefined), + route_rules: + request.routeRules !== undefined + ? request.routeRules.map(elt => + marshalSetRouteRulesRequestRouteRule(elt, defaults), + ) + : undefined, ...resolveOneOf([ - {param: 'after_position', - value: request.afterPosition, - }, - {param: 'before_position', - value: request.beforePosition, - }, + { param: 'after_position', value: request.afterPosition }, + { param: 'before_position', value: request.beforePosition }, ]), }) @@ -760,7 +855,10 @@ export const marshalCheckLbOriginRequest = ( request: CheckLbOriginRequest, defaults: DefaultValues, ): Record => ({ - lb: ((request.lb !== undefined) ? marshalScalewayLb(request.lb, defaults): undefined), + lb: + request.lb !== undefined + ? marshalScalewayLb(request.lb, defaults) + : undefined, }) const marshalCheckPEMChainRequestSecretChain = ( @@ -776,15 +874,16 @@ export const marshalCheckPEMChainRequest = ( defaults: DefaultValues, ): Record => ({ fqdn: request.fqdn, - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf | string>([ - {param: 'secret', - value: (request.secret !== undefined) ? marshalCheckPEMChainRequestSecretChain(request.secret, defaults) - : undefined, - }, - {param: 'raw', - value: request.raw, + { + param: 'secret', + value: + request.secret !== undefined + ? marshalCheckPEMChainRequestSecretChain(request.secret, defaults) + : undefined, }, + { param: 'raw', value: request.raw }, ]), }) @@ -792,7 +891,7 @@ const marshalScalewayLbBackendConfig = ( request: ScalewayLbBackendConfig, defaults: DefaultValues, ): Record => ({ - lbs: request.lbs.map(elt => marshalScalewayLb(elt, defaults)), + lbs: request.lbs.map(elt => marshalScalewayLb(elt, defaults)), }) const marshalScalewayS3BackendConfig = ( @@ -815,19 +914,31 @@ const marshalScalewayServerlessContainerBackendConfig = ( export const marshalCreateBackendStageRequest = ( request: CreateBackendStageRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'scaleway_s3', - value: (request.scalewayS3 !== undefined) ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) - : undefined, + { + param: 'scaleway_s3', + value: + request.scalewayS3 !== undefined + ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) + : undefined, }, - {param: 'scaleway_lb', - value: (request.scalewayLb !== undefined) ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) - : undefined, + { + param: 'scaleway_lb', + value: + request.scalewayLb !== undefined + ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) + : undefined, }, - {param: 'scaleway_serverless_container', - value: (request.scalewayServerlessContainer !== undefined) ? marshalScalewayServerlessContainerBackendConfig(request.scalewayServerlessContainer, defaults) - : undefined, + { + param: 'scaleway_serverless_container', + value: + request.scalewayServerlessContainer !== undefined + ? marshalScalewayServerlessContainerBackendConfig( + request.scalewayServerlessContainer, + defaults, + ) + : undefined, }, ]), }) @@ -837,17 +948,11 @@ export const marshalCreateCacheStageRequest = ( defaults: DefaultValues, ): Record => ({ fallback_ttl: request.fallbackTtl, - include_cookies: request.includeCookies, + include_cookies: request.includeCookies, ...resolveOneOf([ - {param: 'backend_stage_id', - value: request.backendStageId, - }, - {param: 'waf_stage_id', - value: request.wafStageId, - }, - {param: 'route_stage_id', - value: request.routeStageId, - }, + { param: 'backend_stage_id', value: request.backendStageId }, + { param: 'waf_stage_id', value: request.wafStageId }, + { param: 'route_stage_id', value: request.routeStageId }, ]), }) @@ -855,17 +960,11 @@ export const marshalCreateDNSStageRequest = ( request: CreateDNSStageRequest, defaults: DefaultValues, ): Record => ({ - fqdns: request.fqdns, + fqdns: request.fqdns, ...resolveOneOf([ - {param: 'tls_stage_id', - value: request.tlsStageId, - }, - {param: 'cache_stage_id', - value: request.cacheStageId, - }, - {param: 'backend_stage_id', - value: request.backendStageId, - }, + { param: 'tls_stage_id', value: request.tlsStageId }, + { param: 'cache_stage_id', value: request.cacheStageId }, + { param: 'backend_stage_id', value: request.backendStageId }, ]), }) @@ -882,26 +981,18 @@ export const marshalCreatePurgeRequestRequest = ( request: CreatePurgeRequestRequest, defaults: DefaultValues, ): Record => ({ - pipeline_id: request.pipelineId, + pipeline_id: request.pipelineId, ...resolveOneOf([ - {param: 'assets', - value: request.assets, - }, - {param: 'all', - value: request.all, - }, + { param: 'assets', value: request.assets }, + { param: 'all', value: request.all }, ]), }) export const marshalCreateRouteStageRequest = ( request: CreateRouteStageRequest, defaults: DefaultValues, -): Record => ({ - ...resolveOneOf([ - {param: 'waf_stage_id', - value: request.wafStageId, - }, - ]), +): Record => ({ + ...resolveOneOf([{ param: 'waf_stage_id', value: request.wafStageId }]), }) const marshalTLSSecret = ( @@ -917,20 +1008,15 @@ export const marshalCreateTLSStageRequest = ( defaults: DefaultValues, ): Record => ({ managed_certificate: request.managedCertificate, - secrets: ((request.secrets !== undefined) ? request.secrets.map(elt => marshalTLSSecret(elt, defaults)): undefined), + secrets: + request.secrets !== undefined + ? request.secrets.map(elt => marshalTLSSecret(elt, defaults)) + : undefined, ...resolveOneOf([ - {param: 'cache_stage_id', - value: request.cacheStageId, - }, - {param: 'backend_stage_id', - value: request.backendStageId, - }, - {param: 'route_stage_id', - value: request.routeStageId, - }, - {param: 'waf_stage_id', - value: request.wafStageId, - }, + { param: 'cache_stage_id', value: request.cacheStageId }, + { param: 'backend_stage_id', value: request.backendStageId }, + { param: 'route_stage_id', value: request.routeStageId }, + { param: 'waf_stage_id', value: request.wafStageId }, ]), }) @@ -939,11 +1025,9 @@ export const marshalCreateWafStageRequest = ( defaults: DefaultValues, ): Record => ({ mode: request.mode, - paranoia_level: request.paranoiaLevel, + paranoia_level: request.paranoiaLevel, ...resolveOneOf([ - {param: 'backend_stage_id', - value: request.backendStageId, - }, + { param: 'backend_stage_id', value: request.backendStageId }, ]), }) @@ -980,19 +1064,37 @@ const marshalSetHeadStageRequestSwapHeadStage = ( export const marshalSetHeadStageRequest = ( request: SetHeadStageRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'add_new_head_stage', - value: (request.addNewHeadStage !== undefined) ? marshalSetHeadStageRequestAddNewHeadStage(request.addNewHeadStage, defaults) - : undefined, + { + param: 'add_new_head_stage', + value: + request.addNewHeadStage !== undefined + ? marshalSetHeadStageRequestAddNewHeadStage( + request.addNewHeadStage, + defaults, + ) + : undefined, }, - {param: 'remove_head_stage', - value: (request.removeHeadStage !== undefined) ? marshalSetHeadStageRequestRemoveHeadStage(request.removeHeadStage, defaults) - : undefined, + { + param: 'remove_head_stage', + value: + request.removeHeadStage !== undefined + ? marshalSetHeadStageRequestRemoveHeadStage( + request.removeHeadStage, + defaults, + ) + : undefined, }, - {param: 'swap_head_stage', - value: (request.swapHeadStage !== undefined) ? marshalSetHeadStageRequestSwapHeadStage(request.swapHeadStage, defaults) - : undefined, + { + param: 'swap_head_stage', + value: + request.swapHeadStage !== undefined + ? marshalSetHeadStageRequestSwapHeadStage( + request.swapHeadStage, + defaults, + ) + : undefined, }, ]), }) @@ -1001,26 +1103,43 @@ export const marshalSetRouteRulesRequest = ( request: SetRouteRulesRequest, defaults: DefaultValues, ): Record => ({ - route_rules: ((request.routeRules !== undefined) ? request.routeRules.map(elt => marshalSetRouteRulesRequestRouteRule(elt, defaults)): undefined), + route_rules: + request.routeRules !== undefined + ? request.routeRules.map(elt => + marshalSetRouteRulesRequestRouteRule(elt, defaults), + ) + : undefined, }) export const marshalUpdateBackendStageRequest = ( request: UpdateBackendStageRequest, defaults: DefaultValues, ): Record => ({ - pipeline_id: request.pipelineId, + pipeline_id: request.pipelineId, ...resolveOneOf([ - {param: 'scaleway_s3', - value: (request.scalewayS3 !== undefined) ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) - : undefined, + { + param: 'scaleway_s3', + value: + request.scalewayS3 !== undefined + ? marshalScalewayS3BackendConfig(request.scalewayS3, defaults) + : undefined, }, - {param: 'scaleway_lb', - value: (request.scalewayLb !== undefined) ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) - : undefined, + { + param: 'scaleway_lb', + value: + request.scalewayLb !== undefined + ? marshalScalewayLbBackendConfig(request.scalewayLb, defaults) + : undefined, }, - {param: 'scaleway_serverless_container', - value: (request.scalewayServerlessContainer !== undefined) ? marshalScalewayServerlessContainerBackendConfig(request.scalewayServerlessContainer, defaults) - : undefined, + { + param: 'scaleway_serverless_container', + value: + request.scalewayServerlessContainer !== undefined + ? marshalScalewayServerlessContainerBackendConfig( + request.scalewayServerlessContainer, + defaults, + ) + : undefined, }, ]), }) @@ -1030,17 +1149,11 @@ export const marshalUpdateCacheStageRequest = ( defaults: DefaultValues, ): Record => ({ fallback_ttl: request.fallbackTtl, - include_cookies: request.includeCookies, + include_cookies: request.includeCookies, ...resolveOneOf([ - {param: 'backend_stage_id', - value: request.backendStageId, - }, - {param: 'waf_stage_id', - value: request.wafStageId, - }, - {param: 'route_stage_id', - value: request.routeStageId, - }, + { param: 'backend_stage_id', value: request.backendStageId }, + { param: 'waf_stage_id', value: request.wafStageId }, + { param: 'route_stage_id', value: request.routeStageId }, ]), }) @@ -1048,17 +1161,11 @@ export const marshalUpdateDNSStageRequest = ( request: UpdateDNSStageRequest, defaults: DefaultValues, ): Record => ({ - fqdns: request.fqdns, + fqdns: request.fqdns, ...resolveOneOf([ - {param: 'tls_stage_id', - value: request.tlsStageId, - }, - {param: 'cache_stage_id', - value: request.cacheStageId, - }, - {param: 'backend_stage_id', - value: request.backendStageId, - }, + { param: 'tls_stage_id', value: request.tlsStageId }, + { param: 'cache_stage_id', value: request.cacheStageId }, + { param: 'backend_stage_id', value: request.backendStageId }, ]), }) @@ -1073,19 +1180,15 @@ export const marshalUpdatePipelineRequest = ( export const marshalUpdateRouteStageRequest = ( request: UpdateRouteStageRequest, defaults: DefaultValues, -): Record => ({ - ...resolveOneOf([ - {param: 'waf_stage_id', - value: request.wafStageId, - }, - ]), +): Record => ({ + ...resolveOneOf([{ param: 'waf_stage_id', value: request.wafStageId }]), }) const marshalTLSSecretsConfig = ( request: TLSSecretsConfig, defaults: DefaultValues, ): Record => ({ - tls_secrets: request.tlsSecrets.map(elt => marshalTLSSecret(elt, defaults)), + tls_secrets: request.tlsSecrets.map(elt => marshalTLSSecret(elt, defaults)), }) export const marshalUpdateTLSStageRequest = ( @@ -1093,20 +1196,15 @@ export const marshalUpdateTLSStageRequest = ( defaults: DefaultValues, ): Record => ({ managed_certificate: request.managedCertificate, - tls_secrets_config: ((request.tlsSecretsConfig !== undefined) ? marshalTLSSecretsConfig(request.tlsSecretsConfig, defaults): undefined), + tls_secrets_config: + request.tlsSecretsConfig !== undefined + ? marshalTLSSecretsConfig(request.tlsSecretsConfig, defaults) + : undefined, ...resolveOneOf([ - {param: 'cache_stage_id', - value: request.cacheStageId, - }, - {param: 'backend_stage_id', - value: request.backendStageId, - }, - {param: 'route_stage_id', - value: request.routeStageId, - }, - {param: 'waf_stage_id', - value: request.wafStageId, - }, + { param: 'cache_stage_id', value: request.cacheStageId }, + { param: 'backend_stage_id', value: request.backendStageId }, + { param: 'route_stage_id', value: request.routeStageId }, + { param: 'waf_stage_id', value: request.wafStageId }, ]), }) @@ -1115,10 +1213,8 @@ export const marshalUpdateWafStageRequest = ( defaults: DefaultValues, ): Record => ({ mode: request.mode, - paranoia_level: request.paranoiaLevel, + paranoia_level: request.paranoiaLevel, ...resolveOneOf([ - {param: 'backend_stage_id', - value: request.backendStageId, - }, + { param: 'backend_stage_id', value: request.backendStageId }, ]), }) diff --git a/packages_generated/edge_services/src/v1beta1/types.gen.ts b/packages_generated/edge_services/src/v1beta1/types.gen.ts index cae0e4333..3a5db5bf3 100644 --- a/packages_generated/edge_services/src/v1beta1/types.gen.ts +++ b/packages_generated/edge_services/src/v1beta1/types.gen.ts @@ -1,13 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { + Money, + Region as ScwRegion, + Zone as ScwZone, +} from '@scaleway/sdk-client' - -export type DNSStageType = - | 'unknown_type' - | 'auto' - | 'managed' - | 'custom' +export type DNSStageType = 'unknown_type' | 'auto' | 'managed' | 'custom' export type LbOriginError = | 'unknown' @@ -19,13 +18,9 @@ export type ListBackendStagesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListCacheStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListCacheStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListDNSStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListDNSStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListPipelinesRequestOrderBy = | 'created_at_asc' @@ -43,17 +38,11 @@ export type ListPurgeRequestsRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListRouteStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRouteStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListTLSStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListTLSStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListWafStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListWafStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type PipelineErrorCode = | 'unknown_code' @@ -87,10 +76,7 @@ export type PipelineErrorCode = | 'pipeline_invalid_workflow' | 'pipeline_missing_head_stage' -export type PipelineErrorSeverity = - | 'unknown_severity' - | 'warning' - | 'critical' +export type PipelineErrorSeverity = 'unknown_severity' | 'warning' | 'critical' export type PipelineErrorStage = | 'unknown_stage' @@ -99,10 +85,7 @@ export type PipelineErrorStage = | 'cache' | 'backend' -export type PipelineErrorType = - | 'unknown_type' - | 'runtime' - | 'config' +export type PipelineErrorType = 'unknown_type' | 'runtime' | 'config' export type PipelineStatus = | 'unknown_status' @@ -112,17 +95,9 @@ export type PipelineStatus = | 'warning' | 'locked' -export type PlanName = - | 'unknown_name' - | 'starter' - | 'professional' - | 'advanced' +export type PlanName = 'unknown_name' | 'starter' | 'professional' | 'advanced' -export type PurgeRequestStatus = - | 'unknown_status' - | 'done' - | 'error' - | 'pending' +export type PurgeRequestStatus = 'unknown_status' | 'done' | 'error' | 'pending' export type RuleHttpMatchMethodFilter = | 'unknown_method_filter' @@ -146,15 +121,9 @@ export type SearchRouteRulesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type SearchWafStagesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type SearchWafStagesRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type WafStageMode = - | 'unknown_mode' - | 'disable' - | 'log_only' - | 'enable' +export type WafStageMode = 'unknown_mode' | 'disable' | 'log_only' | 'enable' export interface ScalewayLb { /** @@ -183,7 +152,6 @@ export interface ScalewayLb { hasWebsocket?: boolean } - export interface RuleHttpMatchPathFilter { /** * Type of filter to match for the HTTP URL path. For now, all path filters must be written in regex and use the `regex` type. @@ -195,7 +163,6 @@ export interface RuleHttpMatchPathFilter { value: string } - export interface ScalewayLbBackendConfig { /** * Load Balancer information. @@ -203,7 +170,6 @@ export interface ScalewayLbBackendConfig { lbs: ScalewayLb[] } - export interface ScalewayS3BackendConfig { /** * Name of the Bucket. @@ -219,7 +185,6 @@ export interface ScalewayS3BackendConfig { isWebsite?: boolean } - export interface ScalewayServerlessContainerBackendConfig { /** * Region to target. If none is passed will use default region from the config. @@ -228,7 +193,6 @@ export interface ScalewayServerlessContainerBackendConfig { containerId: string } - export interface PipelineError { stage: PipelineErrorStage code: PipelineErrorCode @@ -237,7 +201,6 @@ export interface PipelineError { type: PipelineErrorType } - export interface TLSSecret { /** * ID of the Secret. @@ -249,7 +212,6 @@ export interface TLSSecret { region: ScwRegion } - export interface RuleHttpMatch { /** * HTTP methods to filter for. A request using any of these methods will be considered to match the rule. Possible values are `get`, `post`, `put`, `patch`, `delete`, `head`, `options`. All methods will match if none is provided. @@ -261,7 +223,6 @@ export interface RuleHttpMatch { pathFilter?: RuleHttpMatchPathFilter } - export interface BackendStage { /** * ID of the backend stage. @@ -298,7 +259,6 @@ export interface BackendStage { scalewayServerlessContainer?: ScalewayServerlessContainerBackendConfig } - export interface CacheStage { /** * ID of the cache stage. @@ -342,7 +302,6 @@ export interface CacheStage { routeStageId?: string } - export interface DNSStage { /** * ID of the DNS stage. @@ -392,7 +351,6 @@ export interface DNSStage { backendStageId?: string } - export interface Pipeline { /** * ID of the pipeline. @@ -432,7 +390,6 @@ export interface Pipeline { updatedAt?: Date } - export interface RouteStage { /** * ID of the route stage. @@ -458,7 +415,6 @@ export interface RouteStage { updatedAt?: Date } - export interface TLSStage { /** * ID of the TLS stage. @@ -512,7 +468,6 @@ export interface TLSStage { routeStageId?: string } - export interface WafStage { /** * ID of the WAF stage. @@ -546,7 +501,6 @@ export interface WafStage { backendStageId?: string } - export interface SetRouteRulesRequestRouteRule { /** * Rule condition to be matched. Requests matching the condition defined here will be directly forwarded to the backend specified by the `backend_stage_id` field. Requests that do not match will be checked by the next rule's condition. @@ -562,7 +516,6 @@ export interface SetRouteRulesRequestRouteRule { backendStageId?: string } - export interface RouteRule { /** * Rule condition to be matched. Requests matching the condition defined here will be directly forwarded to the backend specified by the `backend_stage_id` field. Requests that do not match will be checked by the next rule's condition. @@ -586,13 +539,11 @@ export interface RouteRule { routeStageId: string } - export interface CheckPEMChainRequestSecretChain { secretId: string secretRegion: string } - export interface PlanDetails { /** * Subscription plan name. @@ -612,7 +563,6 @@ export interface PlanDetails { wafRequests: number } - export interface PlanUsageDetails { /** * Cost to date (this month) for the corresponding Edge Services subscription plan. @@ -620,7 +570,6 @@ export interface PlanUsageDetails { planCost?: Money } - export interface HeadStageResponseHeadStage { /** * @@ -629,7 +578,6 @@ export interface HeadStageResponseHeadStage { dnsStageId?: string } - export interface ListHeadStagesResponseHeadStage { /** * @@ -638,7 +586,6 @@ export interface ListHeadStagesResponseHeadStage { dnsStageId?: string } - export interface PipelineStages { pipeline?: Pipeline dnsStages: DNSStage[] @@ -649,7 +596,6 @@ export interface PipelineStages { routeStages: RouteStage[] } - export interface PurgeRequest { /** * ID of the purge request. @@ -685,23 +631,19 @@ export interface PurgeRequest { updatedAt?: Date } - export interface SetHeadStageRequestAddNewHeadStage { newStageId: string } - export interface SetHeadStageRequestRemoveHeadStage { removeStageId: string } - export interface SetHeadStageRequestSwapHeadStage { newStageId: string currentStageId: string } - export interface TLSSecretsConfig { /** * Secret information (from Secret Manager). @@ -709,7 +651,6 @@ export interface TLSSecretsConfig { tlsSecrets: TLSSecret[] } - export type AddRouteRulesRequest = { /** * ID of the route stage to update. @@ -733,7 +674,6 @@ export type AddRouteRulesRequest = { beforePosition?: number } - export interface AddRouteRulesResponse { /** * List of rules to be checked against every HTTP request. The first matching rule will forward the request to its specified backend stage. If no rules are matched, the request is forwarded to the WAF stage defined by `waf_stage_id`. @@ -741,30 +681,25 @@ export interface AddRouteRulesResponse { routeRules: RouteRule[] } - export type CheckDomainRequest = { projectId?: string fqdn: string cname: string } - export interface CheckDomainResponse { isValid: boolean } - export type CheckLbOriginRequest = { lb?: ScalewayLb } - export interface CheckLbOriginResponse { isValid: boolean errorType: LbOriginError } - export type CheckPEMChainRequest = { projectId?: string fqdn: string @@ -780,12 +715,10 @@ export type CheckPEMChainRequest = { raw?: string } - export interface CheckPEMChainResponse { isValid: boolean } - export type CreateBackendStageRequest = { /** * Pipeline ID the Backend stage belongs to. @@ -810,7 +743,6 @@ export type CreateBackendStageRequest = { scalewayServerlessContainer?: ScalewayServerlessContainerBackendConfig } - export type CreateCacheStageRequest = { /** * Pipeline ID the Cache stage belongs to. @@ -842,7 +774,6 @@ export type CreateCacheStageRequest = { routeStageId?: string } - export type CreateDNSStageRequest = { /** * Pipeline ID the DNS stage belongs to. @@ -872,7 +803,6 @@ export type CreateDNSStageRequest = { backendStageId?: string } - export type CreatePipelineRequest = { /** * Project ID in which the pipeline will be created. @@ -888,7 +818,6 @@ export type CreatePipelineRequest = { description: string } - export type CreatePurgeRequestRequest = { /** * Pipeline ID in which the purge request will be created. @@ -908,7 +837,6 @@ export type CreatePurgeRequestRequest = { all?: boolean } - export type CreateRouteStageRequest = { /** * Pipeline ID the route stage belongs to. @@ -922,7 +850,6 @@ export type CreateRouteStageRequest = { wafStageId?: string } - export type CreateTLSStageRequest = { /** * Pipeline ID the TLS stage belongs to. @@ -960,7 +887,6 @@ export type CreateTLSStageRequest = { wafStageId?: string } - export type CreateWafStageRequest = { /** * Pipeline ID the WAF stage belongs to. @@ -982,7 +908,6 @@ export type CreateWafStageRequest = { backendStageId?: string } - export type DeleteBackendStageRequest = { /** * ID of the backend stage to delete. @@ -990,7 +915,6 @@ export type DeleteBackendStageRequest = { backendStageId: string } - export type DeleteCacheStageRequest = { /** * ID of the cache stage to delete. @@ -998,12 +922,10 @@ export type DeleteCacheStageRequest = { cacheStageId: string } - export type DeleteCurrentPlanRequest = { projectId?: string } - export type DeleteDNSStageRequest = { /** * ID of the DNS stage to delete. @@ -1011,7 +933,6 @@ export type DeleteDNSStageRequest = { dnsStageId: string } - export type DeletePipelineRequest = { /** * ID of the pipeline to delete. @@ -1019,7 +940,6 @@ export type DeletePipelineRequest = { pipelineId: string } - export type DeleteRouteStageRequest = { /** * ID of the route stage to delete. @@ -1027,7 +947,6 @@ export type DeleteRouteStageRequest = { routeStageId: string } - export type DeleteTLSStageRequest = { /** * ID of the TLS stage to delete. @@ -1035,7 +954,6 @@ export type DeleteTLSStageRequest = { tlsStageId: string } - export type DeleteWafStageRequest = { /** * ID of the WAF stage to delete. @@ -1043,7 +961,6 @@ export type DeleteWafStageRequest = { wafStageId: string } - export type GetBackendStageRequest = { /** * ID of the requested backend stage. @@ -1051,12 +968,10 @@ export type GetBackendStageRequest = { backendStageId: string } - export type GetBillingRequest = { projectId?: string } - export interface GetBillingResponse { /** * Information on the currently-selected, active Edge Services subscription plan. @@ -1112,7 +1027,6 @@ export interface GetBillingResponse { totalCost?: Money } - export type GetCacheStageRequest = { /** * ID of the requested cache stage. @@ -1120,12 +1034,10 @@ export type GetCacheStageRequest = { cacheStageId: string } - export type GetCurrentPlanRequest = { projectId?: string } - export type GetDNSStageRequest = { /** * ID of the requested DNS stage. @@ -1133,7 +1045,6 @@ export type GetDNSStageRequest = { dnsStageId: string } - export type GetPipelineRequest = { /** * ID of the requested pipeline. @@ -1141,7 +1052,6 @@ export type GetPipelineRequest = { pipelineId: string } - export type GetPurgeRequestRequest = { /** * ID of the requested purge request. @@ -1149,7 +1059,6 @@ export type GetPurgeRequestRequest = { purgeRequestId: string } - export type GetRouteStageRequest = { /** * ID of the requested route stage. @@ -1157,7 +1066,6 @@ export type GetRouteStageRequest = { routeStageId: string } - export type GetTLSStageRequest = { /** * ID of the requested TLS stage. @@ -1165,7 +1073,6 @@ export type GetTLSStageRequest = { tlsStageId: string } - export type GetWafStageRequest = { /** * ID of the requested WAF stage. @@ -1173,7 +1080,6 @@ export type GetWafStageRequest = { wafStageId: string } - export interface HeadStageResponse { /** * Modified or created head stage. @@ -1181,7 +1087,6 @@ export interface HeadStageResponse { headStage?: HeadStageResponseHeadStage } - export type ListBackendStagesRequest = { /** * Pipeline ID to filter for. Only backend stages from this pipeline will be returned. @@ -1213,7 +1118,6 @@ export type ListBackendStagesRequest = { lbId?: string } - export interface ListBackendStagesResponse { /** * Paginated list of backend stages. @@ -1225,7 +1129,6 @@ export interface ListBackendStagesResponse { totalCount: number } - export type ListCacheStagesRequest = { /** * Pipeline ID to filter for. Only cache stages from this pipeline will be returned. @@ -1245,7 +1148,6 @@ export type ListCacheStagesRequest = { pageSize?: number } - export interface ListCacheStagesResponse { /** * Paginated list of cache stages. @@ -1257,7 +1159,6 @@ export interface ListCacheStagesResponse { totalCount: number } - export type ListDNSStagesRequest = { /** * Pipeline ID to filter for. Only DNS stages from this pipeline will be returned. @@ -1281,7 +1182,6 @@ export type ListDNSStagesRequest = { fqdn?: string } - export interface ListDNSStagesResponse { /** * Paginated list of DNS stages. @@ -1293,7 +1193,6 @@ export interface ListDNSStagesResponse { totalCount: number } - export type ListHeadStagesRequest = { /** * ID of the pipeline to update. @@ -1309,7 +1208,6 @@ export type ListHeadStagesRequest = { pageSize?: number } - export interface ListHeadStagesResponse { /** * Number of head stages to return per page. @@ -1321,7 +1219,6 @@ export interface ListHeadStagesResponse { totalCount: number } - export type ListPipelinesRequest = { /** * Sort order of pipelines in the response. @@ -1353,7 +1250,6 @@ export type ListPipelinesRequest = { hasBackendStageLb?: boolean } - export interface ListPipelinesResponse { /** * Paginated list of pipelines. @@ -1365,7 +1261,6 @@ export interface ListPipelinesResponse { totalCount: number } - export type ListPipelinesWithStagesRequest = { orderBy?: ListPipelinesWithStagesRequestOrderBy page?: number @@ -1375,19 +1270,16 @@ export type ListPipelinesWithStagesRequest = { projectId?: string } - export interface ListPipelinesWithStagesResponse { pipelines: PipelineStages[] totalCount: number } - export interface ListPlansResponse { totalCount: number plans: PlanDetails[] } - export type ListPurgeRequestsRequest = { /** * Sort order of purge requests in the response. @@ -1415,7 +1307,6 @@ export type ListPurgeRequestsRequest = { pipelineId?: string } - export interface ListPurgeRequestsResponse { /** * Paginated list of purge requests. @@ -1427,7 +1318,6 @@ export interface ListPurgeRequestsResponse { totalCount: number } - export type ListRouteRulesRequest = { /** * Route stage ID to filter for. Only route rules from this route stage will be returned. @@ -1435,7 +1325,6 @@ export type ListRouteRulesRequest = { routeStageId: string } - export interface ListRouteRulesResponse { /** * List of rules to be checked against every HTTP request. The first matching rule will forward the request to its specified backend stage. If no rules are matched, the request is forwarded to the WAF stage defined by `waf_stage_id`. @@ -1447,7 +1336,6 @@ export interface ListRouteRulesResponse { totalCount: number } - export type ListRouteStagesRequest = { /** * Pipeline ID to filter for. Only route stages from this pipeline will be returned. @@ -1467,7 +1355,6 @@ export type ListRouteStagesRequest = { pageSize?: number } - export interface ListRouteStagesResponse { /** * Paginated list of summarized route stages. @@ -1479,7 +1366,6 @@ export interface ListRouteStagesResponse { totalCount: number } - export type ListTLSStagesRequest = { /** * Pipeline ID to filter for. Only TLS stages from this pipeline will be returned. @@ -1507,7 +1393,6 @@ export type ListTLSStagesRequest = { secretRegion?: string } - export interface ListTLSStagesResponse { /** * Paginated list of TLS stages. @@ -1519,7 +1404,6 @@ export interface ListTLSStagesResponse { totalCount: number } - export type ListWafStagesRequest = { /** * Pipeline ID to filter for. Only WAF stages from this pipeline will be returned. @@ -1539,7 +1423,6 @@ export type ListWafStagesRequest = { pageSize?: number } - export interface ListWafStagesResponse { /** * Paginated list of WAF stages. @@ -1551,12 +1434,10 @@ export interface ListWafStagesResponse { totalCount: number } - export interface Plan { planName: PlanName } - export type SearchBackendStagesRequest = { orderBy?: SearchBackendStagesRequestOrderBy page?: number @@ -1567,7 +1448,6 @@ export type SearchBackendStagesRequest = { lbId?: string } - export type SearchRouteRulesRequest = { orderBy?: SearchRouteRulesRequestOrderBy page?: number @@ -1576,7 +1456,6 @@ export type SearchRouteRulesRequest = { projectId?: string } - export type SearchWafStagesRequest = { orderBy?: SearchWafStagesRequestOrderBy page?: number @@ -1584,13 +1463,11 @@ export type SearchWafStagesRequest = { projectId?: string } - export type SelectPlanRequest = { projectId?: string planName?: PlanName } - export type SetHeadStageRequest = { /** * ID of the pipeline to update. @@ -1616,7 +1493,6 @@ export type SetHeadStageRequest = { swapHeadStage?: SetHeadStageRequestSwapHeadStage } - export type SetRouteRulesRequest = { /** * ID of the route stage to update. @@ -1628,7 +1504,6 @@ export type SetRouteRulesRequest = { routeRules?: SetRouteRulesRequestRouteRule[] } - export interface SetRouteRulesResponse { /** * List of rules to be checked against every HTTP request. The first matching rule will forward the request to its specified backend stage. If no rules are matched, the request is forwarded to the WAF stage defined by `waf_stage_id`. @@ -1636,7 +1511,6 @@ export interface SetRouteRulesResponse { routeRules: RouteRule[] } - export type UpdateBackendStageRequest = { /** * ID of the backend stage to update. @@ -1665,7 +1539,6 @@ export type UpdateBackendStageRequest = { scalewayServerlessContainer?: ScalewayServerlessContainerBackendConfig } - export type UpdateCacheStageRequest = { /** * ID of the cache stage to update. @@ -1697,7 +1570,6 @@ export type UpdateCacheStageRequest = { routeStageId?: string } - export type UpdateDNSStageRequest = { /** * ID of the DNS stage to update. @@ -1727,7 +1599,6 @@ export type UpdateDNSStageRequest = { backendStageId?: string } - export type UpdatePipelineRequest = { /** * ID of the pipeline to update. @@ -1743,7 +1614,6 @@ export type UpdatePipelineRequest = { description?: string } - export type UpdateRouteStageRequest = { /** * ID of the route stage to update. @@ -1757,7 +1627,6 @@ export type UpdateRouteStageRequest = { wafStageId?: string } - export type UpdateTLSStageRequest = { /** * ID of the TLS stage to update. @@ -1795,7 +1664,6 @@ export type UpdateTLSStageRequest = { wafStageId?: string } - export type UpdateWafStageRequest = { /** * ID of the WAF stage to update. @@ -1816,5 +1684,3 @@ export type UpdateWafStageRequest = { */ backendStageId?: string } - - diff --git a/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts index 697984d99..2ab4dcbd8 100644 --- a/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts +++ b/packages_generated/environmental_footprint/src/v1alpha1/api.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import { - API as ParentAPI, - urlParams, -} from '@scaleway/sdk-client' +import { API as ParentAPI, urlParams } from '@scaleway/sdk-client' import { unmarshalImpactDataResponse, unmarshalImpactReportAvailability, @@ -33,47 +30,57 @@ export class UserAPI extends ParentAPI { * @param request - The request {@link UserApiGetImpactReportAvailabilityRequest} * @returns A Promise of ImpactReportAvailability */ - getImpactReportAvailability = (request: Readonly = {}) => + getImpactReportAvailability = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/environmental-footprint/v1alpha1/reports/availability`, urlParams: urlParams( ['end_date', request.endDate], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['start_date', request.startDate], ), }, unmarshalImpactReportAvailability, ) - /** * Download PDF impact report. Download a Scaleway impact PDF report with detailed impact data for your Scaleway projects. * * @param request - The request {@link UserApiDownloadImpactReportRequest} * @returns A Promise of Blob */ - downloadImpactReport = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalUserApiDownloadImpactReportRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/environmental-footprint/v1alpha1/reports/download`, - urlParams: urlParams( - ['dl', 1], - ['date', request.date], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ['type', request.type], + downloadImpactReport = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalUserApiDownloadImpactReportRequest( + request, + this.client.settings, ), - responseType: 'blob', - }, - ) + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/environmental-footprint/v1alpha1/reports/download`, + urlParams: urlParams( + ['dl', 1], + ['date', request.date], + [ + 'organization_id', + request.organizationId ?? this.client.settings.defaultOrganizationId, + ], + ['type', request.type], + ), + responseType: 'blob', + }) - /** * Retrieve detailed impact data. Retrieve detailed impact data for your Scaleway projects within a specified date range. Filter by project ID, region, zone, service category, and/or product category. * @@ -87,7 +94,11 @@ export class UserAPI extends ParentAPI { path: `/environmental-footprint/v1alpha1/data/query`, urlParams: urlParams( ['end_date', request.endDate], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['product_categories', request.productCategories], ['project_ids', request.projectIds], ['regions', request.regions], @@ -98,7 +109,4 @@ export class UserAPI extends ParentAPI { }, unmarshalImpactDataResponse, ) - - } - diff --git a/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts index 5c6e49ebc..dbcd9e5cb 100644 --- a/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts +++ b/packages_generated/environmental_footprint/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - UserAPI, -} from './api.gen.js' +export { UserAPI } from './api.gen.js' export * from './marshalling.gen.js' export type { Impact, diff --git a/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts index aee81611f..3a988dd6a 100644 --- a/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/environmental_footprint/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Impact, @@ -36,7 +39,9 @@ const unmarshalSkuImpact = (data: unknown): SkuImpact => { productCategory: data.product_category, serviceCategory: data.service_category, sku: data.sku, - totalSkuImpact: data.total_sku_impact ? unmarshalImpact(data.total_sku_impact) : undefined, + totalSkuImpact: data.total_sku_impact + ? unmarshalImpact(data.total_sku_impact) + : undefined, } as SkuImpact } @@ -49,7 +54,9 @@ const unmarshalZoneImpact = (data: unknown): ZoneImpact => { return { skus: unmarshalArrayOfObject(data.skus, unmarshalSkuImpact), - totalZoneImpact: data.total_zone_impact ? unmarshalImpact(data.total_zone_impact) : undefined, + totalZoneImpact: data.total_zone_impact + ? unmarshalImpact(data.total_zone_impact) + : undefined, zone: data.zone, } as ZoneImpact } @@ -63,7 +70,9 @@ const unmarshalRegionImpact = (data: unknown): RegionImpact => { return { region: data.region, - totalRegionImpact: data.total_region_impact ? unmarshalImpact(data.total_region_impact) : undefined, + totalRegionImpact: data.total_region_impact + ? unmarshalImpact(data.total_region_impact) + : undefined, zones: unmarshalArrayOfObject(data.zones, unmarshalZoneImpact), } as RegionImpact } @@ -78,11 +87,15 @@ const unmarshalProjectImpact = (data: unknown): ProjectImpact => { return { projectId: data.project_id, regions: unmarshalArrayOfObject(data.regions, unmarshalRegionImpact), - totalProjectImpact: data.total_project_impact ? unmarshalImpact(data.total_project_impact) : undefined, + totalProjectImpact: data.total_project_impact + ? unmarshalImpact(data.total_project_impact) + : undefined, } as ProjectImpact } -export const unmarshalImpactDataResponse = (data: unknown): ImpactDataResponse => { +export const unmarshalImpactDataResponse = ( + data: unknown, +): ImpactDataResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ImpactDataResponse' failed as data isn't a dictionary.`, @@ -93,11 +106,15 @@ export const unmarshalImpactDataResponse = (data: unknown): ImpactDataResponse = endDate: unmarshalDate(data.end_date), projects: unmarshalArrayOfObject(data.projects, unmarshalProjectImpact), startDate: unmarshalDate(data.start_date), - totalImpact: data.total_impact ? unmarshalImpact(data.total_impact) : undefined, + totalImpact: data.total_impact + ? unmarshalImpact(data.total_impact) + : undefined, } as ImpactDataResponse } -export const unmarshalImpactReportAvailability = (data: unknown): ImpactReportAvailability => { +export const unmarshalImpactReportAvailability = ( + data: unknown, +): ImpactReportAvailability => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ImpactReportAvailability' failed as data isn't a dictionary.`, @@ -105,7 +122,10 @@ export const unmarshalImpactReportAvailability = (data: unknown): ImpactReportAv } return { - monthSummaryReports: unmarshalArrayOfObject(data.month_summary_reports, unmarshalDate), + monthSummaryReports: unmarshalArrayOfObject( + data.month_summary_reports, + unmarshalDate, + ), } as ImpactReportAvailability } diff --git a/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts b/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts index 1ddb5895e..58062dafc 100644 --- a/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts +++ b/packages_generated/environmental_footprint/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' export type ProductCategory = | 'unknown_product_category' @@ -12,10 +11,7 @@ export type ProductCategory = | 'instances' | 'object_storage' -export type ReportType = - | 'unknown_report_type' - | 'monthly' - | 'yearly' +export type ReportType = 'unknown_report_type' | 'monthly' | 'yearly' export type ServiceCategory = | 'unknown_service_category' @@ -34,7 +30,6 @@ export interface Impact { m3WaterUsage: number } - export interface SkuImpact { /** * Unique ID of the combination of product, region and zone. @@ -54,7 +49,6 @@ export interface SkuImpact { productCategory: ProductCategory } - export interface ZoneImpact { /** * ID of the zone. @@ -70,7 +64,6 @@ export interface ZoneImpact { skus: SkuImpact[] } - export interface RegionImpact { /** * ID of the region. @@ -86,7 +79,6 @@ export interface RegionImpact { zones: ZoneImpact[] } - export interface ProjectImpact { /** * ID of the project. @@ -102,7 +94,6 @@ export interface ProjectImpact { regions: RegionImpact[] } - export interface ImpactDataResponse { /** * Start date of the impact data period (inclusive). @@ -122,7 +113,6 @@ export interface ImpactDataResponse { projects: ProjectImpact[] } - export interface ImpactReportAvailability { /** * The list of calendar months for which impact reports are available. @@ -130,7 +120,6 @@ export interface ImpactReportAvailability { monthSummaryReports: Date[] } - export type UserApiDownloadImpactReportRequest = { /** * The UUID of the Organization for which you want to download a report. @@ -146,7 +135,6 @@ export type UserApiDownloadImpactReportRequest = { type?: ReportType } - export type UserApiGetImpactDataRequest = { /** * The UUID of the Organization for which you want to download a report. @@ -182,7 +170,6 @@ export type UserApiGetImpactDataRequest = { productCategories?: ProductCategory[] } - export type UserApiGetImpactReportAvailabilityRequest = { /** * The UUID of the Organization for which you want to download a report. @@ -197,5 +184,3 @@ export type UserApiGetImpactReportAvailabilityRequest = { */ endDate?: Date } - - diff --git a/packages_generated/file/src/v1alpha1/api.gen.ts b/packages_generated/file/src/v1alpha1/api.gen.ts index 422cb5d78..e0ae4ff3f 100644 --- a/packages_generated/file/src/v1alpha1/api.gen.ts +++ b/packages_generated/file/src/v1alpha1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {FILE_SYSTEM_TRANSIENT_STATUSES as FILE_SYSTEM_TRANSIENT_STATUSES_FILE,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { FILE_SYSTEM_TRANSIENT_STATUSES as FILE_SYSTEM_TRANSIENT_STATUSES_FILE } from './content.gen.js' import { marshalCreateFileSystemRequest, unmarshalFileSystem, @@ -43,13 +43,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + /** * Get filesystem details. Retrieve all properties and current status of a specific filesystem identified by its ID. * @@ -64,7 +61,7 @@ export class API extends ParentAPI { }, unmarshalFileSystem, ) - + /** * Waits for {@link FileSystem} to be in a final state. * @@ -77,14 +74,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!FILE_SYSTEM_TRANSIENT_STATUSES_FILE.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !FILE_SYSTEM_TRANSIENT_STATUSES_FILE.includes(res.status), + )), this.getFileSystem, request, options, ) - - protected pageOfListFileSystems = (request: Readonly = {}) => + protected pageOfListFileSystems = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -94,14 +96,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListFileSystemsResponse, ) - + /** * List all filesystems. Retrieve all filesystems in the specified region. By default, the filesystems listed are ordered by creation date in ascending order. This can be modified using the `order_by` field. * @@ -111,8 +116,9 @@ export class API extends ParentAPI { listFileSystems = (request: Readonly = {}) => enrichForPagination('filesystems', this.pageOfListFileSystems, request) - - protected pageOfListAttachments = (request: Readonly = {}) => + protected pageOfListAttachments = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -120,7 +126,10 @@ export class API extends ParentAPI { urlParams: urlParams( ['filesystem_id', request.filesystemId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['resource_id', request.resourceId], ['resource_type', request.resourceType], ['zone', request.zone], @@ -128,7 +137,7 @@ export class API extends ParentAPI { }, unmarshalListAttachmentsResponse, ) - + /** * List filesystems attachments. List all existing attachments in a specified region. By default, the attachments listed are ordered by creation date in ascending order. This can be modified using the `order_by` field. @@ -139,7 +148,6 @@ By default, the attachments listed are ordered by creation date in ascending ord listAttachments = (request: Readonly = {}) => enrichForPagination('attachments', this.pageOfListAttachments, request) - /** * Create a new filesystem. To create a new filesystem, you must specify a name, a size, and a project ID. * @@ -159,21 +167,17 @@ By default, the attachments listed are ordered by creation date in ascending ord unmarshalFileSystem, ) - /** * Delete a detached filesystem. You must specify the `filesystem_id` of the filesystem you want to delete. * * @param request - The request {@link DeleteFileSystemRequest} */ deleteFileSystem = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/file/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/filesystems/${validatePathParam('filesystemId', request.filesystemId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/file/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/filesystems/${validatePathParam('filesystemId', request.filesystemId)}`, + }) - /** * Update filesystem properties. Update the technical details of a filesystem, such as its name, tags or its new size. * @@ -192,7 +196,4 @@ By default, the attachments listed are ordered by creation date in ascending ord }, unmarshalFileSystem, ) - - } - diff --git a/packages_generated/file/src/v1alpha1/content.gen.ts b/packages_generated/file/src/v1alpha1/content.gen.ts index 93c956e1b..7f1f89c59 100644 --- a/packages_generated/file/src/v1alpha1/content.gen.ts +++ b/packages_generated/file/src/v1alpha1/content.gen.ts @@ -1,13 +1,9 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - FileSystemStatus, -} from './types.gen.js' - +import type { FileSystemStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link FileSystemStatus}. */ export const FILE_SYSTEM_TRANSIENT_STATUSES: FileSystemStatus[] = [ 'creating', 'updating', ] - diff --git a/packages_generated/file/src/v1alpha1/index.gen.ts b/packages_generated/file/src/v1alpha1/index.gen.ts index 223ce70e4..200c87c4e 100644 --- a/packages_generated/file/src/v1alpha1/index.gen.ts +++ b/packages_generated/file/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/file/src/v1alpha1/marshalling.gen.ts b/packages_generated/file/src/v1alpha1/marshalling.gen.ts index bacb5e77d..0fa2aa95e 100644 --- a/packages_generated/file/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/file/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { FileSystem, @@ -48,7 +51,9 @@ const unmarshalAttachment = (data: unknown): Attachment => { } as Attachment } -export const unmarshalListAttachmentsResponse = (data: unknown): ListAttachmentsResponse => { +export const unmarshalListAttachmentsResponse = ( + data: unknown, +): ListAttachmentsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAttachmentsResponse' failed as data isn't a dictionary.`, @@ -61,7 +66,9 @@ export const unmarshalListAttachmentsResponse = (data: unknown): ListAttachments } as ListAttachmentsResponse } -export const unmarshalListFileSystemsResponse = (data: unknown): ListFileSystemsResponse => { +export const unmarshalListFileSystemsResponse = ( + data: unknown, +): ListFileSystemsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFileSystemsResponse' failed as data isn't a dictionary.`, diff --git a/packages_generated/file/src/v1alpha1/types.gen.ts b/packages_generated/file/src/v1alpha1/types.gen.ts index c2e331446..26f18c73f 100644 --- a/packages_generated/file/src/v1alpha1/types.gen.ts +++ b/packages_generated/file/src/v1alpha1/types.gen.ts @@ -1,11 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' - -export type AttachmentResourceType = - | 'unknown_resource_type' - | 'instance_server' +export type AttachmentResourceType = 'unknown_resource_type' | 'instance_server' export type FileSystemStatus = | 'unknown_status' @@ -46,7 +43,6 @@ export interface Attachment { zone?: ScwZone } - /** * Represents a filesystem resource and its properties. */ @@ -97,7 +93,6 @@ export interface FileSystem { updatedAt?: Date } - /** * Request to create a new filesystem. */ @@ -124,7 +119,6 @@ export type CreateFileSystemRequest = { tags?: string[] } - /** * Request to delete a specific filesystem. */ @@ -139,7 +133,6 @@ export type DeleteFileSystemRequest = { filesystemId: string } - /** * Request to retrieve a specific filesystem. */ @@ -154,7 +147,6 @@ export type GetFileSystemRequest = { filesystemId: string } - /** * Request to list filesystem attachments with filtering and pagination options. */ @@ -189,7 +181,6 @@ export type ListAttachmentsRequest = { pageSize?: number } - /** * Response containing a list of filesystem attachments and total count. */ @@ -204,7 +195,6 @@ export interface ListAttachmentsResponse { totalCount: number } - /** * Request to list filesystems with filtering and pagination options. */ @@ -243,7 +233,6 @@ export type ListFileSystemsRequest = { tags?: string[] } - /** * Response containing a list of filesystems and total count. */ @@ -258,7 +247,6 @@ export interface ListFileSystemsResponse { totalCount: number } - /** * Request to update a specific filesystem. */ @@ -285,5 +273,3 @@ Must be compliant with the minimum (100 GB) and maximum (10 TB) allowed size. */ tags?: string[] } - - diff --git a/packages_generated/flexibleip/src/v1alpha1/api.gen.ts b/packages_generated/flexibleip/src/v1alpha1/api.gen.ts index b947a27a2..6846f90f6 100644 --- a/packages_generated/flexibleip/src/v1alpha1/api.gen.ts +++ b/packages_generated/flexibleip/src/v1alpha1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {FLEXIBLE_IP_TRANSIENT_STATUSES as FLEXIBLE_IP_TRANSIENT_STATUSES_FLEXIBLEIP,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { FLEXIBLE_IP_TRANSIENT_STATUSES as FLEXIBLE_IP_TRANSIENT_STATUSES_FLEXIBLEIP } from './content.gen.js' import { marshalAttachFlexibleIPRequest, unmarshalAttachFlexibleIPsResponse, @@ -55,18 +55,17 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + /** * Create a new flexible IP. Generate a new flexible IP within a given zone, specifying its configuration including Project ID and description. * @@ -86,7 +85,6 @@ export class API extends ParentAPI { unmarshalFlexibleIP, ) - /** * Get an existing flexible IP. Retrieve information about an existing flexible IP, specified by its ID and zone. Its full details, including Project ID, description and status, are returned in the response object. * @@ -101,7 +99,7 @@ export class API extends ParentAPI { }, unmarshalFlexibleIP, ) - + /** * Waits for {@link FlexibleIP} to be in a final state. * @@ -114,14 +112,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!FLEXIBLE_IP_TRANSIENT_STATUSES_FLEXIBLEIP.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !FLEXIBLE_IP_TRANSIENT_STATUSES_FLEXIBLEIP.includes(res.status), + )), this.getFlexibleIP, request, options, ) - - protected pageOfListFlexibleIPs = (request: Readonly = {}) => + protected pageOfListFlexibleIPs = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -130,7 +133,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['server_ids', request.serverIds], ['status', request.status], @@ -139,7 +145,7 @@ export class API extends ParentAPI { }, unmarshalListFlexibleIPsResponse, ) - + /** * List flexible IPs. List all flexible IPs within a given zone. * @@ -149,7 +155,6 @@ export class API extends ParentAPI { listFlexibleIPs = (request: Readonly = {}) => enrichForPagination('flexibleIps', this.pageOfListFlexibleIPs, request) - /** * Update an existing flexible IP. Update the parameters of an existing flexible IP, specified by its ID and zone. These parameters include tags and description. * @@ -169,21 +174,17 @@ export class API extends ParentAPI { unmarshalFlexibleIP, ) - /** * Delete an existing flexible IP. Delete an existing flexible IP, specified by its ID and zone. Note that deleting a flexible IP is permanent and cannot be undone. * * @param request - The request {@link DeleteFlexibleIPRequest} */ deleteFlexibleIP = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}`, + }) - /** * Attach an existing flexible IP to a server. Attach an existing flexible IP to a specified Elastic Metal server. * @@ -203,7 +204,6 @@ export class API extends ParentAPI { unmarshalAttachFlexibleIPsResponse, ) - /** * Detach an existing flexible IP from a server. Detach an existing flexible IP from a specified Elastic Metal server. * @@ -223,7 +223,6 @@ export class API extends ParentAPI { unmarshalDetachFlexibleIPsResponse, ) - /** * Generate a virtual MAC address on an existing flexible IP. Generate a virtual MAC (Media Access Control) address on an existing flexible IP. * @@ -243,7 +242,6 @@ export class API extends ParentAPI { unmarshalFlexibleIP, ) - /** * Duplicate a virtual MAC address to another flexible IP. Duplicate a virtual MAC address from a given flexible IP to another flexible IP attached to the same server. * @@ -263,7 +261,6 @@ export class API extends ParentAPI { unmarshalFlexibleIP, ) - /** * Relocate an existing virtual MAC address to a different flexible IP. Relocate a virtual MAC (Media Access Control) address from an existing flexible IP to a different flexible IP. * @@ -283,20 +280,14 @@ export class API extends ParentAPI { unmarshalFlexibleIP, ) - /** * Detach a given virtual MAC address from an existing flexible IP. Detach a given MAC (Media Access Control) address from an existing flexible IP. * * @param request - The request {@link DeleteMACAddrRequest} */ deleteMACAddr = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/flexible-ip/v1alpha1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/fips/${validatePathParam('fipId', request.fipId)}/mac`, + }) } - diff --git a/packages_generated/flexibleip/src/v1alpha1/content.gen.ts b/packages_generated/flexibleip/src/v1alpha1/content.gen.ts index 5960d7c62..bb0da0a45 100644 --- a/packages_generated/flexibleip/src/v1alpha1/content.gen.ts +++ b/packages_generated/flexibleip/src/v1alpha1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - FlexibleIPStatus, - MACAddressStatus, -} from './types.gen.js' - +import type { FlexibleIPStatus, MACAddressStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link FlexibleIPStatus}. */ export const FLEXIBLE_IP_TRANSIENT_STATUSES: FlexibleIPStatus[] = [ @@ -17,4 +13,3 @@ export const MAC_ADDRESS_TRANSIENT_STATUSES: MACAddressStatus[] = [ 'updating', 'deleting', ] - diff --git a/packages_generated/flexibleip/src/v1alpha1/index.gen.ts b/packages_generated/flexibleip/src/v1alpha1/index.gen.ts index ac4605a4a..30b0d385f 100644 --- a/packages_generated/flexibleip/src/v1alpha1/index.gen.ts +++ b/packages_generated/flexibleip/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/flexibleip/src/v1alpha1/marshalling.gen.ts b/packages_generated/flexibleip/src/v1alpha1/marshalling.gen.ts index 92baae3ee..3cfa4031f 100644 --- a/packages_generated/flexibleip/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/flexibleip/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { MACAddress, @@ -46,7 +49,9 @@ export const unmarshalFlexibleIP = (data: unknown): FlexibleIP => { description: data.description, id: data.id, ipAddress: data.ip_address, - macAddress: data.mac_address ? unmarshalMACAddress(data.mac_address) : undefined, + macAddress: data.mac_address + ? unmarshalMACAddress(data.mac_address) + : undefined, organizationId: data.organization_id, projectId: data.project_id, reverse: data.reverse, @@ -58,7 +63,9 @@ export const unmarshalFlexibleIP = (data: unknown): FlexibleIP => { } as FlexibleIP } -export const unmarshalAttachFlexibleIPsResponse = (data: unknown): AttachFlexibleIPsResponse => { +export const unmarshalAttachFlexibleIPsResponse = ( + data: unknown, +): AttachFlexibleIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AttachFlexibleIPsResponse' failed as data isn't a dictionary.`, @@ -71,7 +78,9 @@ export const unmarshalAttachFlexibleIPsResponse = (data: unknown): AttachFlexibl } as AttachFlexibleIPsResponse } -export const unmarshalDetachFlexibleIPsResponse = (data: unknown): DetachFlexibleIPsResponse => { +export const unmarshalDetachFlexibleIPsResponse = ( + data: unknown, +): DetachFlexibleIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DetachFlexibleIPsResponse' failed as data isn't a dictionary.`, @@ -84,7 +93,9 @@ export const unmarshalDetachFlexibleIPsResponse = (data: unknown): DetachFlexibl } as DetachFlexibleIPsResponse } -export const unmarshalListFlexibleIPsResponse = (data: unknown): ListFlexibleIPsResponse => { +export const unmarshalListFlexibleIPsResponse = ( + data: unknown, +): ListFlexibleIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFlexibleIPsResponse' failed as data isn't a dictionary.`, diff --git a/packages_generated/flexibleip/src/v1alpha1/types.gen.ts b/packages_generated/flexibleip/src/v1alpha1/types.gen.ts index 56d30babc..7b7a4d100 100644 --- a/packages_generated/flexibleip/src/v1alpha1/types.gen.ts +++ b/packages_generated/flexibleip/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Zone as ScwZone } from '@scaleway/sdk-client' export type FlexibleIPStatus = | 'unknown' @@ -12,9 +11,7 @@ export type FlexibleIPStatus = | 'detaching' | 'locked' -export type ListFlexibleIPsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListFlexibleIPsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type MACAddressStatus = | 'unknown' @@ -24,11 +21,7 @@ export type MACAddressStatus = | 'error' | 'deleting' -export type MACAddressType = - | 'unknown_type' - | 'vmware' - | 'xen' - | 'kvm' +export type MACAddressType = 'unknown_type' | 'vmware' | 'xen' | 'kvm' export interface MACAddress { /** @@ -61,7 +54,6 @@ export interface MACAddress { zone: ScwZone } - export interface FlexibleIP { /** * ID of the flexible IP. @@ -122,7 +114,6 @@ export interface FlexibleIP { zone: ScwZone } - export type AttachFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -138,7 +129,6 @@ export type AttachFlexibleIPRequest = { serverId: string } - export interface AttachFlexibleIPsResponse { /** * Total count of flexible IPs that are being updated. @@ -150,7 +140,6 @@ export interface AttachFlexibleIPsResponse { flexibleIps: FlexibleIP[] } - export type CreateFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -182,7 +171,6 @@ export type CreateFlexibleIPRequest = { isIpv6: boolean } - export type DeleteFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -194,7 +182,6 @@ export type DeleteFlexibleIPRequest = { fipId: string } - export type DeleteMACAddrRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -206,7 +193,6 @@ export type DeleteMACAddrRequest = { fipId: string } - export type DetachFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -218,7 +204,6 @@ export type DetachFlexibleIPRequest = { fipsIds: string[] } - export interface DetachFlexibleIPsResponse { /** * Total count of flexible IPs that are being detached. @@ -230,7 +215,6 @@ export interface DetachFlexibleIPsResponse { flexibleIps: FlexibleIP[] } - export type DuplicateMACAddrRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -246,7 +230,6 @@ export type DuplicateMACAddrRequest = { duplicateFromFipId: string } - export type GenerateMACAddrRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -262,7 +245,6 @@ export type GenerateMACAddrRequest = { macType: MACAddressType } - export type GetFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -274,7 +256,6 @@ export type GetFlexibleIPRequest = { fipId: string } - export type ListFlexibleIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -314,7 +295,6 @@ export type ListFlexibleIPsRequest = { projectId?: string } - export interface ListFlexibleIPsResponse { /** * Total count of matching flexible IPs. @@ -326,7 +306,6 @@ export interface ListFlexibleIPsResponse { flexibleIps: FlexibleIP[] } - export type MoveMACAddrRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -336,7 +315,6 @@ export type MoveMACAddrRequest = { dstFipId: string } - export type UpdateFlexibleIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -359,5 +337,3 @@ export type UpdateFlexibleIPRequest = { */ reverse?: string } - - diff --git a/packages_generated/function/src/v1beta1/api.gen.ts b/packages_generated/function/src/v1beta1/api.gen.ts index f6723f402..ae1d3cf67 100644 --- a/packages_generated/function/src/v1beta1/api.gen.ts +++ b/packages_generated/function/src/v1beta1/api.gen.ts @@ -9,8 +9,15 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CRON_TRANSIENT_STATUSES as CRON_TRANSIENT_STATUSES_FUNCTION,DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_FUNCTION,FUNCTION_TRANSIENT_STATUSES as FUNCTION_TRANSIENT_STATUSES_FUNCTION,NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_FUNCTION,TOKEN_TRANSIENT_STATUSES as TOKEN_TRANSIENT_STATUSES_FUNCTION,TRIGGER_TRANSIENT_STATUSES as TRIGGER_TRANSIENT_STATUSES_FUNCTION,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + CRON_TRANSIENT_STATUSES as CRON_TRANSIENT_STATUSES_FUNCTION, + DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_FUNCTION, + FUNCTION_TRANSIENT_STATUSES as FUNCTION_TRANSIENT_STATUSES_FUNCTION, + NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_FUNCTION, + TOKEN_TRANSIENT_STATUSES as TOKEN_TRANSIENT_STATUSES_FUNCTION, + TRIGGER_TRANSIENT_STATUSES as TRIGGER_TRANSIENT_STATUSES_FUNCTION, +} from './content.gen.js' import { marshalCreateCronRequest, marshalCreateDomainRequest, @@ -102,16 +109,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListNamespaces = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListNamespaces = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -121,13 +125,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListNamespacesResponse, ) - + /** * List all your namespaces. List all existing namespaces in the specified region. * @@ -137,7 +144,6 @@ export class API extends ParentAPI { listNamespaces = (request: Readonly = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request) - /** * Get a namespace. Get the namespace associated with the specified ID. * @@ -152,7 +158,7 @@ export class API extends ParentAPI { }, unmarshalNamespace, ) - + /** * Waits for {@link Namespace} to be in a final state. * @@ -165,13 +171,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !NAMESPACE_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getNamespace, request, options, ) - /** * Create a new namespace. Create a new namespace in a specified Organization or Project. * @@ -191,7 +200,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Update an existing namespace. Update the namespace associated with the specified ID. * @@ -211,7 +219,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Delete an existing namespace. Delete the namespace associated with the specified ID. * @@ -227,7 +234,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - protected pageOfListFunctions = (request: Readonly) => this.client.fetch( { @@ -239,13 +245,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListFunctionsResponse, ) - + /** * List all your functions. * @@ -255,7 +264,6 @@ export class API extends ParentAPI { listFunctions = (request: Readonly) => enrichForPagination('functions', this.pageOfListFunctions, request) - /** * Get a function. Get the function associated with the specified ID. * @@ -270,7 +278,7 @@ export class API extends ParentAPI { }, unmarshalFunction, ) - + /** * Waits for {@link Function} to be in a final state. * @@ -283,13 +291,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!FUNCTION_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !FUNCTION_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getFunction, request, options, ) - /** * Create a new function. Create a new function in the specified region for a specified Organization or Project. * @@ -309,7 +320,6 @@ export class API extends ParentAPI { unmarshalFunction, ) - /** * Update an existing function. Update the function associated with the specified ID. @@ -332,7 +342,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalFunction, ) - /** * Delete a function. Delete the function associated with the specified ID. * @@ -348,7 +357,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalFunction, ) - /** * Deploy a function. Deploy a function associated with the specified ID. * @@ -366,14 +374,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalFunction, ) - /** * List function runtimes. List available function runtimes. * * @param request - The request {@link ListFunctionRuntimesRequest} * @returns A Promise of ListFunctionRuntimesResponse */ - listFunctionRuntimes = (request: Readonly = {}) => + listFunctionRuntimes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -382,7 +391,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalListFunctionRuntimesResponse, ) - /** * Get an upload URL of a function. Get an upload URL of a function associated with the specified ID. * @@ -394,14 +402,11 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r { method: 'GET', path: `/functions/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/functions/${validatePathParam('functionId', request.functionId)}/upload-url`, - urlParams: urlParams( - ['content_length', request.contentLength], - ), + urlParams: urlParams(['content_length', request.contentLength]), }, unmarshalUploadURL, ) - /** * Get a download URL of a function. Get a download URL for a function associated with the specified ID. * @@ -417,7 +422,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalDownloadURL, ) - protected pageOfListCrons = (request: Readonly) => this.client.fetch( { @@ -427,12 +431,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['function_id', request.functionId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCronsResponse, ) - + /** * List all crons. List all the cronjobs in a specified region. * @@ -442,7 +449,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listCrons = (request: Readonly) => enrichForPagination('crons', this.pageOfListCrons, request) - /** * Get a cron. Get the cron associated with the specified ID. * @@ -457,7 +463,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalCron, ) - + /** * Waits for {@link Cron} to be in a final state. * @@ -470,13 +476,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CRON_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CRON_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getCron, request, options, ) - /** * Create a new cron. Create a new cronjob for a function with the specified ID. * @@ -496,7 +505,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - /** * Update an existing cron. Update the cron associated with the specified ID. * @@ -516,7 +524,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - /** * Delete an existing cron. Delete the cron associated with the specified ID. * @@ -532,7 +539,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalCron, ) - protected pageOfListDomains = (request: Readonly) => this.client.fetch( { @@ -542,12 +548,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['function_id', request.functionId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDomainsResponse, ) - + /** * List all domain name bindings. List all domain name bindings in a specified region. * @@ -557,7 +566,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listDomains = (request: Readonly) => enrichForPagination('domains', this.pageOfListDomains, request) - /** * Get a domain name binding. Get a domain name binding for the function with the specified ID. * @@ -572,7 +580,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalDomain, ) - + /** * Waits for {@link Domain} to be in a final state. * @@ -585,13 +593,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DOMAIN_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getDomain, request, options, ) - /** * Create a domain name binding. Create a domain name binding for the function with the specified ID. * @@ -611,7 +622,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalDomain, ) - /** * Delete a domain name binding. Delete a domain name binding for the function with the specified ID. * @@ -627,7 +637,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalDomain, ) - /** * Create a new revocable token. Deprecated in favor of IAM authentication. * @@ -648,7 +657,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalToken, ) - /** * Get a token. * @@ -663,7 +671,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalToken, ) - + /** * Waits for {@link Token} to be in a final state. * @@ -676,13 +684,16 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!TOKEN_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !TOKEN_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getToken, request, options, ) - protected pageOfListTokens = (request: Readonly = {}) => this.client.fetch( { @@ -693,12 +704,15 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r ['namespace_id', request.namespaceId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListTokensResponse, ) - + /** * List all tokens. * @@ -708,7 +722,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listTokens = (request: Readonly = {}) => enrichForPagination('tokens', this.pageOfListTokens, request) - /** * Delete a token. * @@ -724,7 +737,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalToken, ) - /** * Create a trigger. Create a new trigger for a specified function. * @@ -744,7 +756,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalTrigger, ) - /** * Get a trigger. Get a trigger with a specified ID. * @@ -759,7 +770,7 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalTrigger, ) - + /** * Waits for {@link Trigger} to be in a final state. * @@ -772,14 +783,19 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!TRIGGER_TRANSIENT_STATUSES_FUNCTION.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !TRIGGER_TRANSIENT_STATUSES_FUNCTION.includes(res.status), + )), this.getTrigger, request, options, ) - - protected pageOfListTriggers = (request: Readonly = {}) => + protected pageOfListTriggers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -787,23 +803,26 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ...Object.entries(resolveOneOf([ - {param: 'function_id', - value: request.functionId, - }, - {param: 'namespace_id', - value: request.namespaceId, - }, - {default: this.client.settings.defaultProjectId,param: 'project_id', - value: request.projectId, - }, - ])), + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ...Object.entries( + resolveOneOf([ + { param: 'function_id', value: request.functionId }, + { param: 'namespace_id', value: request.namespaceId }, + { + default: this.client.settings.defaultProjectId, + param: 'project_id', + value: request.projectId, + }, + ]), + ), ), }, unmarshalListTriggersResponse, ) - + /** * List all triggers. List all triggers belonging to a specified Organization or Project. * @@ -813,7 +832,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r listTriggers = (request: Readonly = {}) => enrichForPagination('triggers', this.pageOfListTriggers, request) - /** * Update a trigger. Update a trigger with a specified ID. * @@ -833,7 +851,6 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r unmarshalTrigger, ) - /** * Delete a trigger. Delete a trigger with a specified ID. * @@ -848,7 +865,4 @@ This behavior can be changed by setting the `redeploy` field to `false` in the r }, unmarshalTrigger, ) - - } - diff --git a/packages_generated/function/src/v1beta1/content.gen.ts b/packages_generated/function/src/v1beta1/content.gen.ts index 4cad03ad0..f1d0457df 100644 --- a/packages_generated/function/src/v1beta1/content.gen.ts +++ b/packages_generated/function/src/v1beta1/content.gen.ts @@ -9,7 +9,6 @@ import type { TriggerStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link CronStatus}. */ export const CRON_TRANSIENT_STATUSES: CronStatus[] = [ 'deleting', @@ -39,10 +38,7 @@ export const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[] = [ ] /** Lists transient statutes of the enum {@link TokenStatus}. */ -export const TOKEN_TRANSIENT_STATUSES: TokenStatus[] = [ - 'deleting', - 'creating', -] +export const TOKEN_TRANSIENT_STATUSES: TokenStatus[] = ['deleting', 'creating'] /** Lists transient statutes of the enum {@link TriggerStatus}. */ export const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[] = [ @@ -50,4 +46,3 @@ export const TRIGGER_TRANSIENT_STATUSES: TriggerStatus[] = [ 'creating', 'pending', ] - diff --git a/packages_generated/function/src/v1beta1/index.gen.ts b/packages_generated/function/src/v1beta1/index.gen.ts index e90749d23..9e50b015a 100644 --- a/packages_generated/function/src/v1beta1/index.gen.ts +++ b/packages_generated/function/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/function/src/v1beta1/marshalling.gen.ts b/packages_generated/function/src/v1beta1/marshalling.gen.ts index 90313480f..1d53cf066 100644 --- a/packages_generated/function/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/function/src/v1beta1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Cron, @@ -118,7 +123,10 @@ export const unmarshalFunction = (data: unknown): Function => { runtime: data.runtime, runtimeMessage: data.runtime_message, sandbox: data.sandbox, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), + secretEnvironmentVariables: unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue, + ), status: data.status, tags: data.tags, timeout: data.timeout, @@ -145,7 +153,10 @@ export const unmarshalNamespace = (data: unknown): Namespace => { region: data.region, registryEndpoint: data.registry_endpoint, registryNamespaceId: data.registry_namespace_id, - secretEnvironmentVariables: unmarshalArrayOfObject(data.secret_environment_variables, unmarshalSecretHashedValue), + secretEnvironmentVariables: unmarshalArrayOfObject( + data.secret_environment_variables, + unmarshalSecretHashedValue, + ), status: data.status, tags: data.tags, updatedAt: unmarshalDate(data.updated_at), @@ -172,7 +183,9 @@ export const unmarshalToken = (data: unknown): Token => { } as Token } -const unmarshalTriggerMnqNatsClientConfig = (data: unknown): TriggerMnqNatsClientConfig => { +const unmarshalTriggerMnqNatsClientConfig = ( + data: unknown, +): TriggerMnqNatsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerMnqNatsClientConfig' failed as data isn't a dictionary.`, @@ -188,7 +201,9 @@ const unmarshalTriggerMnqNatsClientConfig = (data: unknown): TriggerMnqNatsClien } as TriggerMnqNatsClientConfig } -const unmarshalTriggerMnqSqsClientConfig = (data: unknown): TriggerMnqSqsClientConfig => { +const unmarshalTriggerMnqSqsClientConfig = ( + data: unknown, +): TriggerMnqSqsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerMnqSqsClientConfig' failed as data isn't a dictionary.`, @@ -203,7 +218,9 @@ const unmarshalTriggerMnqSqsClientConfig = (data: unknown): TriggerMnqSqsClientC } as TriggerMnqSqsClientConfig } -const unmarshalTriggerSqsClientConfig = (data: unknown): TriggerSqsClientConfig => { +const unmarshalTriggerSqsClientConfig = ( + data: unknown, +): TriggerSqsClientConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'TriggerSqsClientConfig' failed as data isn't a dictionary.`, @@ -232,9 +249,15 @@ export const unmarshalTrigger = (data: unknown): Trigger => { id: data.id, inputType: data.input_type, name: data.name, - scwNatsConfig: data.scw_nats_config ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) : undefined, - scwSqsConfig: data.scw_sqs_config ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) : undefined, - sqsConfig: data.sqs_config ? unmarshalTriggerSqsClientConfig(data.sqs_config) : undefined, + scwNatsConfig: data.scw_nats_config + ? unmarshalTriggerMnqNatsClientConfig(data.scw_nats_config) + : undefined, + scwSqsConfig: data.scw_sqs_config + ? unmarshalTriggerMnqSqsClientConfig(data.scw_sqs_config) + : undefined, + sqsConfig: data.sqs_config + ? unmarshalTriggerSqsClientConfig(data.sqs_config) + : undefined, status: data.status, } as Trigger } @@ -252,7 +275,9 @@ export const unmarshalDownloadURL = (data: unknown): DownloadURL => { } as DownloadURL } -export const unmarshalListCronsResponse = (data: unknown): ListCronsResponse => { +export const unmarshalListCronsResponse = ( + data: unknown, +): ListCronsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCronsResponse' failed as data isn't a dictionary.`, @@ -265,7 +290,9 @@ export const unmarshalListCronsResponse = (data: unknown): ListCronsResponse => } as ListCronsResponse } -export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse => { +export const unmarshalListDomainsResponse = ( + data: unknown, +): ListDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`, @@ -299,7 +326,9 @@ const unmarshalRuntime = (data: unknown): Runtime => { } as Runtime } -export const unmarshalListFunctionRuntimesResponse = (data: unknown): ListFunctionRuntimesResponse => { +export const unmarshalListFunctionRuntimesResponse = ( + data: unknown, +): ListFunctionRuntimesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFunctionRuntimesResponse' failed as data isn't a dictionary.`, @@ -312,7 +341,9 @@ export const unmarshalListFunctionRuntimesResponse = (data: unknown): ListFuncti } as ListFunctionRuntimesResponse } -export const unmarshalListFunctionsResponse = (data: unknown): ListFunctionsResponse => { +export const unmarshalListFunctionsResponse = ( + data: unknown, +): ListFunctionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFunctionsResponse' failed as data isn't a dictionary.`, @@ -325,7 +356,9 @@ export const unmarshalListFunctionsResponse = (data: unknown): ListFunctionsResp } as ListFunctionsResponse } -export const unmarshalListNamespacesResponse = (data: unknown): ListNamespacesResponse => { +export const unmarshalListNamespacesResponse = ( + data: unknown, +): ListNamespacesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`, @@ -338,7 +371,9 @@ export const unmarshalListNamespacesResponse = (data: unknown): ListNamespacesRe } as ListNamespacesResponse } -export const unmarshalListTokensResponse = (data: unknown): ListTokensResponse => { +export const unmarshalListTokensResponse = ( + data: unknown, +): ListTokensResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTokensResponse' failed as data isn't a dictionary.`, @@ -351,7 +386,9 @@ export const unmarshalListTokensResponse = (data: unknown): ListTokensResponse = } as ListTokensResponse } -export const unmarshalListTriggersResponse = (data: unknown): ListTriggersResponse => { +export const unmarshalListTriggersResponse = ( + data: unknown, +): ListTriggersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTriggersResponse' failed as data isn't a dictionary.`, @@ -420,7 +457,12 @@ export const marshalCreateFunctionRequest = ( private_network_id: request.privateNetworkId, runtime: request.runtime, sandbox: request.sandbox, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, timeout: request.timeout, }) @@ -434,7 +476,12 @@ export const marshalCreateNamespaceRequest = ( environment_variables: request.environmentVariables, name: request.name || randomName('ns'), project_id: request.projectId ?? defaults.defaultProjectId, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, }) @@ -443,14 +490,10 @@ export const marshalCreateTokenRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - expires_at: request.expiresAt, + expires_at: request.expiresAt, ...resolveOneOf([ - {param: 'function_id', - value: request.functionId, - }, - {param: 'namespace_id', - value: request.namespaceId, - }, + { param: 'function_id', value: request.functionId }, + { param: 'namespace_id', value: request.namespaceId }, ]), }) @@ -489,19 +532,37 @@ export const marshalCreateTriggerRequest = ( ): Record => ({ description: request.description, function_id: request.functionId, - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'scw_sqs_config', - value: (request.scwSqsConfig !== undefined) ? marshalCreateTriggerRequestMnqSqsClientConfig(request.scwSqsConfig, defaults) - : undefined, + { + param: 'scw_sqs_config', + value: + request.scwSqsConfig !== undefined + ? marshalCreateTriggerRequestMnqSqsClientConfig( + request.scwSqsConfig, + defaults, + ) + : undefined, }, - {param: 'scw_nats_config', - value: (request.scwNatsConfig !== undefined) ? marshalCreateTriggerRequestMnqNatsClientConfig(request.scwNatsConfig, defaults) - : undefined, + { + param: 'scw_nats_config', + value: + request.scwNatsConfig !== undefined + ? marshalCreateTriggerRequestMnqNatsClientConfig( + request.scwNatsConfig, + defaults, + ) + : undefined, }, - {param: 'sqs_config', - value: (request.sqsConfig !== undefined) ? marshalCreateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) - : undefined, + { + param: 'sqs_config', + value: + request.sqsConfig !== undefined + ? marshalCreateTriggerRequestSqsClientConfig( + request.sqsConfig, + defaults, + ) + : undefined, }, ]), }) @@ -532,7 +593,12 @@ export const marshalUpdateFunctionRequest = ( redeploy: request.redeploy, runtime: request.runtime, sandbox: request.sandbox, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, timeout: request.timeout, }) @@ -543,7 +609,12 @@ export const marshalUpdateNamespaceRequest = ( ): Record => ({ description: request.description, environment_variables: request.environmentVariables, - secret_environment_variables: ((request.secretEnvironmentVariables !== undefined) ? request.secretEnvironmentVariables.map(elt => marshalSecret(elt, defaults)): undefined), + secret_environment_variables: + request.secretEnvironmentVariables !== undefined + ? request.secretEnvironmentVariables.map(elt => + marshalSecret(elt, defaults), + ) + : undefined, tags: request.tags, }) @@ -560,11 +631,17 @@ export const marshalUpdateTriggerRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'sqs_config', - value: (request.sqsConfig !== undefined) ? marshalUpdateTriggerRequestSqsClientConfig(request.sqsConfig, defaults) - : undefined, + { + param: 'sqs_config', + value: + request.sqsConfig !== undefined + ? marshalUpdateTriggerRequestSqsClientConfig( + request.sqsConfig, + defaults, + ) + : undefined, }, ]), }) diff --git a/packages_generated/function/src/v1beta1/types.gen.ts b/packages_generated/function/src/v1beta1/types.gen.ts index c7e0921b6..82f212d6d 100644 --- a/packages_generated/function/src/v1beta1/types.gen.ts +++ b/packages_generated/function/src/v1beta1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type CronStatus = | 'unknown' @@ -25,10 +24,7 @@ export type FunctionHttpOption = | 'enabled' | 'redirected' -export type FunctionPrivacy = - | 'unknown_privacy' - | 'public' - | 'private' +export type FunctionPrivacy = 'unknown_privacy' | 'public' | 'private' export type FunctionRuntime = | 'unknown_runtime' @@ -67,10 +63,7 @@ export type FunctionRuntime = | 'rust185' | 'php84' -export type FunctionSandbox = - | 'unknown_sandbox' - | 'v1' - | 'v2' +export type FunctionSandbox = 'unknown_sandbox' | 'v1' | 'v2' export type FunctionStatus = | 'unknown' @@ -82,9 +75,7 @@ export type FunctionStatus = | 'pending' | 'created' -export type ListCronsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListCronsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListDomainsRequestOrderBy = | 'created_at_asc' @@ -104,13 +95,9 @@ export type ListNamespacesRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListTokensRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type ListTriggersRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListTriggersRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type NamespaceStatus = | 'unknown' @@ -156,7 +143,6 @@ export interface SecretHashedValue { hashedValue: string } - export interface TriggerMnqNatsClientConfig { /** * Name of the NATS subject the trigger listens to. @@ -180,7 +166,6 @@ export interface TriggerMnqNatsClientConfig { mnqCredentialId?: string } - export interface TriggerMnqSqsClientConfig { /** * Name of the SQS queue the trigger listens to. @@ -200,7 +185,6 @@ export interface TriggerMnqSqsClientConfig { mnqCredentialId?: string } - export interface TriggerSqsClientConfig { endpoint: string queueUrl: string @@ -208,13 +192,11 @@ export interface TriggerSqsClientConfig { secretKey: string } - export interface Secret { key: string value?: string } - export interface CreateTriggerRequestMnqNatsClientConfig { /** * Name of the NATS subject the trigger should listen to. @@ -234,7 +216,6 @@ export interface CreateTriggerRequestMnqNatsClientConfig { mnqRegion: string } - export interface CreateTriggerRequestMnqSqsClientConfig { /** * Name of the SQS queue the trigger should listen to. @@ -250,7 +231,6 @@ export interface CreateTriggerRequestMnqSqsClientConfig { mnqRegion: string } - export interface CreateTriggerRequestSqsClientConfig { endpoint: string queueUrl: string @@ -258,7 +238,6 @@ export interface CreateTriggerRequestSqsClientConfig { secretKey: string } - export interface Cron { /** * UUID of the cron. @@ -286,7 +265,6 @@ export interface Cron { name: string } - export interface Domain { /** * UUID of the domain. @@ -314,7 +292,6 @@ export interface Domain { errorMessage?: string } - export interface Runtime { name: string language: string @@ -328,7 +305,6 @@ export interface Runtime { logoUrl: string } - export interface Function { /** * UUID of the function. @@ -439,7 +415,6 @@ export interface Function { privateNetworkId?: string } - export interface Namespace { /** * UUID of the namespace. @@ -507,7 +482,6 @@ export interface Namespace { vpcIntegrationActivated?: boolean } - export interface Token { /** * UUID of the token. @@ -547,7 +521,6 @@ export interface Token { expiresAt?: Date } - export interface Trigger { /** * ID of the trigger. @@ -597,13 +570,11 @@ export interface Trigger { sqsConfig?: TriggerSqsClientConfig } - export interface UpdateTriggerRequestSqsClientConfig { accessKey?: string secretKey?: string } - export type CreateCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -627,7 +598,6 @@ export type CreateCronRequest = { name?: string } - export type CreateDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -643,7 +613,6 @@ export type CreateDomainRequest = { functionId: string } - export type CreateFunctionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -714,7 +683,6 @@ export type CreateFunctionRequest = { privateNetworkId?: string } - export type CreateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -747,7 +715,6 @@ export type CreateNamespaceRequest = { activateVpcIntegration?: boolean } - export type CreateTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -775,7 +742,6 @@ export type CreateTokenRequest = { expiresAt?: Date } - export type CreateTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -813,7 +779,6 @@ export type CreateTriggerRequest = { sqsConfig?: CreateTriggerRequestSqsClientConfig } - export type DeleteCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -825,7 +790,6 @@ export type DeleteCronRequest = { cronId: string } - export type DeleteDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -837,7 +801,6 @@ export type DeleteDomainRequest = { domainId: string } - export type DeleteFunctionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -849,7 +812,6 @@ export type DeleteFunctionRequest = { functionId: string } - export type DeleteNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -861,7 +823,6 @@ export type DeleteNamespaceRequest = { namespaceId: string } - export type DeleteTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -873,7 +834,6 @@ export type DeleteTokenRequest = { tokenId: string } - export type DeleteTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -885,7 +845,6 @@ export type DeleteTriggerRequest = { triggerId: string } - export type DeployFunctionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -897,13 +856,11 @@ export type DeployFunctionRequest = { functionId: string } - export interface DownloadURL { url: string headers: Record } - export type GetCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -915,7 +872,6 @@ export type GetCronRequest = { cronId: string } - export type GetDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -927,7 +883,6 @@ export type GetDomainRequest = { domainId: string } - export type GetFunctionDownloadURLRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -939,7 +894,6 @@ export type GetFunctionDownloadURLRequest = { functionId: string } - export type GetFunctionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -951,7 +905,6 @@ export type GetFunctionRequest = { functionId: string } - export type GetFunctionUploadURLRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -967,7 +920,6 @@ export type GetFunctionUploadURLRequest = { contentLength: number } - export type GetNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -979,7 +931,6 @@ export type GetNamespaceRequest = { namespaceId: string } - export type GetTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -991,7 +942,6 @@ export type GetTokenRequest = { tokenId: string } - export type GetTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1003,7 +953,6 @@ export type GetTriggerRequest = { triggerId: string } - export type ListCronsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1027,7 +976,6 @@ export type ListCronsRequest = { functionId: string } - export interface ListCronsResponse { /** * Array of crons. @@ -1039,7 +987,6 @@ export interface ListCronsResponse { totalCount: number } - export type ListDomainsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1063,7 +1010,6 @@ export type ListDomainsRequest = { functionId: string } - export interface ListDomainsResponse { /** * Array of domains. @@ -1075,7 +1021,6 @@ export interface ListDomainsResponse { totalCount: number } - export type ListFunctionRuntimesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1083,7 +1028,6 @@ export type ListFunctionRuntimesRequest = { region?: ScwRegion } - export interface ListFunctionRuntimesResponse { /** * Array of runtimes available. @@ -1095,7 +1039,6 @@ export interface ListFunctionRuntimesResponse { totalCount: number } - export type ListFunctionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1131,7 +1074,6 @@ export type ListFunctionsRequest = { projectId?: string } - export interface ListFunctionsResponse { /** * Array of functions. @@ -1143,7 +1085,6 @@ export interface ListFunctionsResponse { totalCount: number } - export type ListNamespacesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1175,7 +1116,6 @@ export type ListNamespacesRequest = { projectId?: string } - export interface ListNamespacesResponse { namespaces: Namespace[] /** @@ -1184,7 +1124,6 @@ export interface ListNamespacesResponse { totalCount: number } - export type ListTokensRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1212,13 +1151,11 @@ export type ListTokensRequest = { namespaceId?: string } - export interface ListTokensResponse { tokens: Token[] totalCount: number } - export type ListTriggersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1256,7 +1193,6 @@ export type ListTriggersRequest = { projectId?: string } - export interface ListTriggersResponse { /** * Total count of existing triggers (matching any filters specified). @@ -1268,7 +1204,6 @@ export interface ListTriggersResponse { triggers: Trigger[] } - export type UpdateCronRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1296,7 +1231,6 @@ export type UpdateCronRequest = { name?: string } - export type UpdateFunctionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1381,7 +1315,6 @@ For example, the following payload will delete the `TO_DELETE` secret environmen privateNetworkId?: string } - export type UpdateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1409,7 +1342,6 @@ export type UpdateNamespaceRequest = { tags?: string[] } - export type UpdateTriggerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1435,7 +1367,6 @@ export type UpdateTriggerRequest = { sqsConfig?: UpdateTriggerRequestSqsClientConfig } - export interface UploadURL { /** * Upload URL to upload the function to. @@ -1446,5 +1377,3 @@ export interface UploadURL { */ headers: Record } - - diff --git a/packages_generated/iam/src/v1alpha1/api.gen.ts b/packages_generated/iam/src/v1alpha1/api.gen.ts index 3ac528ae7..811af932a 100644 --- a/packages_generated/iam/src/v1alpha1/api.gen.ts +++ b/packages_generated/iam/src/v1alpha1/api.gen.ts @@ -211,13 +211,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSSHKeysResponse, ) - + /** * List SSH keys. List SSH keys. By default, the SSH keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `organization_id`, `name`, `project_id` and `disabled`. * @@ -227,7 +230,6 @@ export class API extends ParentAPI { listSSHKeys = (request: Readonly = {}) => enrichForPagination('sshKeys', this.pageOfListSSHKeys, request) - /** * Create an SSH key. Add a new SSH key to a Scaleway Project. You must specify the `name`, `public_key` and `project_id`. * @@ -247,7 +249,6 @@ export class API extends ParentAPI { unmarshalSSHKey, ) - /** * Get an SSH key. Retrieve information about a given SSH key, specified by the `ssh_key_id` parameter. The SSH key's full details, including `id`, `name`, `public_key`, and `project_id` are returned in the response. * @@ -263,7 +264,6 @@ export class API extends ParentAPI { unmarshalSSHKey, ) - /** * Update an SSH key. Update the parameters of an SSH key, including `name` and `disable`. * @@ -283,21 +283,17 @@ export class API extends ParentAPI { unmarshalSSHKey, ) - /** * Delete an SSH key. Delete a given SSH key, specified by the `ssh_key_id`. Deleting an SSH is permanent, and cannot be undone. Note that you might need to update any configurations that used the SSH key. * * @param request - The request {@link DeleteSSHKeyRequest} */ deleteSSHKey = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/ssh-keys/${validatePathParam('sshKeyId', request.sshKeyId)}`, + }) - protected pageOfListUsers = (request: Readonly = {}) => this.client.fetch( { @@ -306,9 +302,16 @@ export class API extends ParentAPI { urlParams: urlParams( ['mfa', request.mfa], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['tag', request.tag], ['type', request.type], ['user_ids', request.userIds], @@ -316,7 +319,7 @@ export class API extends ParentAPI { }, unmarshalListUsersResponse, ) - + /** * List users of an Organization. List the users of an Organization. By default, the users listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `user_ids`. * @@ -326,7 +329,6 @@ export class API extends ParentAPI { listUsers = (request: Readonly = {}) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Get a given user. Retrieve information about a user, specified by the `user_id` parameter. The user's full details, including `id`, `email`, `organization_id`, `status` and `mfa` are returned in the response. * @@ -342,7 +344,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update a user. Update the parameters of a user, including `tags`. * @@ -362,21 +363,17 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Delete a guest user from an Organization. Remove a user from an Organization in which they are a guest. You must define the `user_id` in your request. Note that removing a user from an Organization automatically deletes their API keys, and any policies directly attached to them become orphaned. * * @param request - The request {@link DeleteUserRequest} */ deleteUser = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}`, + }) - /** * Create a new user. Create a new user. You must define the `organization_id` in your request. If you are adding a member, enter the member's details. If you are adding a guest, you must define the `email` and not add the member attribute. * @@ -396,7 +393,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update an user's username.. Update an user's username. * @@ -416,7 +412,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update an user's password.. Update an user's password. * @@ -436,7 +431,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Create a MFA OTP.. Create a MFA OTP. * @@ -454,7 +448,6 @@ export class API extends ParentAPI { unmarshalMFAOTP, ) - /** * Validate a MFA OTP.. Validate a MFA OTP. * @@ -474,23 +467,19 @@ export class API extends ParentAPI { unmarshalValidateUserMFAOTPResponse, ) - /** * Delete a MFA OTP.. Delete a MFA OTP. * * @param request - The request {@link DeleteUserMFAOTPRequest} */ deleteUserMFAOTP = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'DELETE', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/mfa-otp`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'DELETE', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/mfa-otp`, + }) - /** * Lock a member. Lock a member. A locked member cannot log in or use API keys until the locked status is removed. * @@ -508,7 +497,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Unlock a member. * @@ -526,7 +514,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * List grace periods of a member. List the grace periods of a member. * @@ -538,14 +525,11 @@ export class API extends ParentAPI { { method: 'GET', path: `/iam/v1alpha1/grace-periods`, - urlParams: urlParams( - ['user_id', request.userId], - ), + urlParams: urlParams(['user_id', request.userId]), }, unmarshalListGracePeriodsResponse, ) - getUserConnections = (request: Readonly) => this.client.fetch( { @@ -555,7 +539,6 @@ export class API extends ParentAPI { unmarshalGetUserConnectionsResponse, ) - initiateUserConnection = (request: Readonly) => this.client.fetch( { @@ -567,34 +550,29 @@ export class API extends ParentAPI { unmarshalInitiateUserConnectionResponse, ) - joinUserConnection = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalJoinUserConnectionRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/join-connection`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalJoinUserConnectionRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/join-connection`, + }) - removeUserConnection = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalRemoveUserConnectionRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/remove-connection`, - }, - ) - - - protected pageOfListApplications = (request: Readonly = {}) => + this.client.fetch({ + body: JSON.stringify( + marshalRemoveUserConnectionRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/iam/v1alpha1/users/${validatePathParam('userId', request.userId)}/remove-connection`, + }) + + protected pageOfListApplications = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -604,15 +582,22 @@ export class API extends ParentAPI { ['editable', request.editable], ['name', request.name], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['tag', request.tag], ), }, unmarshalListApplicationsResponse, ) - + /** * List applications of an Organization. List the applications of an Organization. By default, the applications listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters for your query such as `application_ids`. * @@ -622,7 +607,6 @@ export class API extends ParentAPI { listApplications = (request: Readonly = {}) => enrichForPagination('applications', this.pageOfListApplications, request) - /** * Create a new application. Create a new application. You must define the `name` parameter in the request. * @@ -642,7 +626,6 @@ export class API extends ParentAPI { unmarshalApplication, ) - /** * Get a given application. Retrieve information about an application, specified by the `application_id` parameter. The application's full details, including `id`, `email`, `organization_id`, `status` and `two_factor_enabled` are returned in the response. * @@ -658,7 +641,6 @@ export class API extends ParentAPI { unmarshalApplication, ) - /** * Update an application. Update the parameters of an application, including `name` and `description`. * @@ -678,21 +660,17 @@ export class API extends ParentAPI { unmarshalApplication, ) - /** * Delete an application. Delete an application. Note that this action is irreversible and will automatically delete the application's API keys. Policies attached to users and applications via this group will no longer apply. * * @param request - The request {@link DeleteApplicationRequest} */ deleteApplication = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/applications/${validatePathParam('applicationId', request.applicationId)}`, + }) - protected pageOfListGroups = (request: Readonly = {}) => this.client.fetch( { @@ -703,16 +681,23 @@ export class API extends ParentAPI { ['group_ids', request.groupIds], ['name', request.name], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['tag', request.tag], ['user_ids', request.userIds], ), }, unmarshalListGroupsResponse, ) - + /** * List groups. List groups. By default, the groups listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters to filter your query. Use `user_ids` or `application_ids` to list all groups certain users or applications belong to. * @@ -722,7 +707,6 @@ export class API extends ParentAPI { listGroups = (request: Readonly = {}) => enrichForPagination('groups', this.pageOfListGroups, request) - /** * Create a group. Create a new group. You must define the `name` and `organization_id` parameters in the request. * @@ -742,7 +726,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Get a group. Retrieve information about a given group, specified by the `group_id` parameter. The group's full details, including `user_ids` and `application_ids` are returned in the response. * @@ -758,7 +741,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Update a group. Update the parameters of group, including `name` and `description`. * @@ -778,7 +760,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Overwrite users and applications of a group. Overwrite users and applications configuration in a group. Any information that you add using this command will overwrite the previous configuration. * @@ -798,7 +779,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Add a user or an application to a group. Add a user or an application to a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only add one of each per request. * @@ -818,7 +798,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Add multiple users and applications to a group. Add multiple users and applications to a group in a single call. You can specify an array of `user_id`s and `application_id`s. Note that any existing users and applications in the group will remain. To add new users/applications and delete pre-existing ones, use the [Overwrite users and applications of a group](#path-groups-overwrite-users-and-applications-of-a-group) method. * @@ -838,7 +817,6 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Remove a user or an application from a group. Remove a user or an application from a group. You can specify a `user_id` and `application_id` in the body of your request. Note that you can only remove one of each per request. Removing a user from a group means that any permissions given to them via the group (i.e. from an attached policy) will no longer apply. Be sure you want to remove these permissions from the user before proceeding. * @@ -858,22 +836,20 @@ export class API extends ParentAPI { unmarshalGroup, ) - /** * Delete a group. Delete a group. Note that this action is irreversible and could delete permissions for group members. Policies attached to users and applications via this group will no longer apply. * * @param request - The request {@link DeleteGroupRequest} */ deleteGroup = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`, - }, - ) - - - protected pageOfListPolicies = (request: Readonly = {}) => + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/groups/${validatePathParam('groupId', request.groupId)}`, + }) + + protected pageOfListPolicies = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -884,9 +860,16 @@ export class API extends ParentAPI { ['group_ids', request.groupIds], ['no_principal', request.noPrincipal], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['policy_ids', request.policyIds], ['policy_name', request.policyName], ['tag', request.tag], @@ -895,7 +878,7 @@ export class API extends ParentAPI { }, unmarshalListPoliciesResponse, ) - + /** * List policies of an Organization. List the policies of an Organization. By default, the policies listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. You can also define additional parameters to filter your query, such as `user_ids`, `groups_ids`, `application_ids`, and `policy_name`. * @@ -905,7 +888,6 @@ export class API extends ParentAPI { listPolicies = (request: Readonly = {}) => enrichForPagination('policies', this.pageOfListPolicies, request) - /** * Create a new policy. Create a new application. You must define the `name` parameter in the request. You can specify parameters such as `user_id`, `groups_id`, `application_id`, `no_principal`, `rules` and its child attributes. * @@ -925,7 +907,6 @@ export class API extends ParentAPI { unmarshalPolicy, ) - /** * Get an existing policy. Retrieve information about a policy, specified by the `policy_id` parameter. The policy's full details, including `id`, `name`, `organization_id`, `nb_rules` and `nb_scopes`, `nb_permission_sets` are returned in the response. * @@ -941,7 +922,6 @@ export class API extends ParentAPI { unmarshalPolicy, ) - /** * Update an existing policy. Update the parameters of a policy, including `name`, `description`, `user_id`, `group_id`, `application_id` and `no_principal`. * @@ -961,21 +941,17 @@ export class API extends ParentAPI { unmarshalPolicy, ) - /** * Delete a policy. Delete a policy. You must define specify the `policy_id` parameter in your request. Note that when deleting a policy, all permissions it gives to its principal (user, group or application) will be revoked. * * @param request - The request {@link DeletePolicyRequest} */ deletePolicy = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/policies/${validatePathParam('policyId', request.policyId)}`, + }) - /** * Clone a policy. Clone a policy. You must define specify the `policy_id` parameter in your request. * @@ -993,7 +969,6 @@ export class API extends ParentAPI { unmarshalPolicy, ) - /** * Set rules of a given policy. Overwrite the rules of a given policy. Any information that you add using this command will overwrite the previous configuration. If you include some of the rules you already had in your previous configuration in your new one, but you change their order, the new order of display will apply. While policy rules are ordered, they have no impact on the access logic of IAM because rules are allow-only. * @@ -1013,7 +988,6 @@ export class API extends ParentAPI { unmarshalSetRulesResponse, ) - protected pageOfListRules = (request: Readonly) => this.client.fetch( { @@ -1021,13 +995,16 @@ export class API extends ParentAPI { path: `/iam/v1alpha1/rules`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['policy_id', request.policyId], ), }, unmarshalListRulesResponse, ) - + /** * List rules of a given policy. List the rules of a given policy. By default, the rules listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `policy_id` in the query path of your request. * @@ -1037,22 +1014,30 @@ export class API extends ParentAPI { listRules = (request: Readonly) => enrichForPagination('rules', this.pageOfListRules, request) - - protected pageOfListPermissionSets = (request: Readonly = {}) => + protected pageOfListPermissionSets = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/iam/v1alpha1/permission-sets`, urlParams: urlParams( ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListPermissionSetsResponse, ) - + /** * List permission sets. List permission sets available for given Organization. You must define the `organization_id` in the query path of your request. * @@ -1060,9 +1045,12 @@ export class API extends ParentAPI { * @returns A Promise of ListPermissionSetsResponse */ listPermissionSets = (request: Readonly = {}) => - enrichForPagination('permissionSets', this.pageOfListPermissionSets, request) + enrichForPagination( + 'permissionSets', + this.pageOfListPermissionSets, + request, + ) - protected pageOfListAPIKeys = (request: Readonly = {}) => this.client.fetch( { @@ -1077,22 +1065,27 @@ export class API extends ParentAPI { ['editable', request.editable], ['expired', request.expired], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ...Object.entries(resolveOneOf([ - {param: 'application_id', - value: request.applicationId, - }, - {param: 'user_id', - value: request.userId, - }, - ])), + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ...Object.entries( + resolveOneOf([ + { param: 'application_id', value: request.applicationId }, + { param: 'user_id', value: request.userId }, + ]), + ), ), }, unmarshalListAPIKeysResponse, ) - + /** * List API keys. List API keys. By default, the API keys listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You can define additional parameters for your query such as `editable`, `expired`, `access_key` and `bearer_id`. * @@ -1102,7 +1095,6 @@ export class API extends ParentAPI { listAPIKeys = (request: Readonly = {}) => enrichForPagination('apiKeys', this.pageOfListAPIKeys, request) - /** * Create an API key. Create an API key. You must specify the `application_id` or the `user_id` and the description. You can also specify the `default_project_id`, which is the Project ID of your preferred Project, to use with Object Storage. The `access_key` and `secret_key` values are returned in the response. Note that the secret key is only shown once. Make sure that you copy and store both keys somewhere safe. * @@ -1122,7 +1114,6 @@ export class API extends ParentAPI { unmarshalAPIKey, ) - /** * Get an API key. Retrieve information about an API key, specified by the `access_key` parameter. The API key's details, including either the `user_id` or `application_id` of its bearer are returned in the response. Note that the string value for the `secret_key` is nullable, and therefore is not displayed in the response. The `secret_key` value is only displayed upon API key creation. * @@ -1138,7 +1129,6 @@ export class API extends ParentAPI { unmarshalAPIKey, ) - /** * Update an API key. Update the parameters of an API key, including `default_project_id` and `description`. * @@ -1158,21 +1148,17 @@ export class API extends ParentAPI { unmarshalAPIKey, ) - /** * Delete an API key. Delete an API key. Note that this action is irreversible and cannot be undone. Make sure you update any configurations using the API keys you delete. * * @param request - The request {@link DeleteAPIKeyRequest} */ deleteAPIKey = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/api-keys/${validatePathParam('accessKey', request.accessKey)}`, + }) - protected pageOfListQuota = (request: Readonly = {}) => this.client.fetch( { @@ -1180,15 +1166,22 @@ export class API extends ParentAPI { path: `/iam/v1alpha1/quota`, urlParams: urlParams( ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['quotum_names', request.quotumNames], ), }, unmarshalListQuotaResponse, ) - + /** * List all quotas in the Organization. List all product and features quota for an Organization, with their associated limits. By default, the quota listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. You must define the `organization_id` in the query path of your request. * @@ -1198,7 +1191,6 @@ export class API extends ParentAPI { listQuota = (request: Readonly = {}) => enrichForPagination('quota', this.pageOfListQuota, request) - /** * Get a quota in the Organization. Retrieve information about a resource quota, specified by the `quotum_name` parameter. The quota's `limit`, or whether it is unlimited, is returned in the response. * @@ -1210,14 +1202,14 @@ export class API extends ParentAPI { { method: 'GET', path: `/iam/v1alpha1/quota/${validatePathParam('quotumName', request.quotumName)}`, - urlParams: urlParams( - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], - ), + urlParams: urlParams([ + 'organization_id', + request.organizationId ?? this.client.settings.defaultOrganizationId, + ]), }, unmarshalQuotum, ) - protected pageOfListJWTs = (request: Readonly) => this.client.fetch( { @@ -1228,12 +1220,15 @@ export class API extends ParentAPI { ['expired', request.expired], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListJWTsResponse, ) - + /** * List JWTs. * @@ -1243,7 +1238,6 @@ export class API extends ParentAPI { listJWTs = (request: Readonly) => enrichForPagination('jwts', this.pageOfListJWTs, request) - /** * Create a JWT. * @@ -1263,7 +1257,6 @@ export class API extends ParentAPI { unmarshalEncodedJWT, ) - /** * Get a JWT. * @@ -1279,21 +1272,17 @@ export class API extends ParentAPI { unmarshalJWT, ) - /** * Delete a JWT. * * @param request - The request {@link DeleteJWTRequest} */ deleteJWT = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/jwts/${validatePathParam('jti', request.jti)}`, + }) - protected pageOfListLogs = (request: Readonly = {}) => this.client.fetch( { @@ -1304,16 +1293,23 @@ export class API extends ParentAPI { ['created_after', request.createdAfter], ['created_before', request.createdBefore], ['order_by', request.orderBy], - ['organization_id', request.organizationId ?? this.client.settings.defaultOrganizationId], + [ + 'organization_id', + request.organizationId ?? + this.client.settings.defaultOrganizationId, + ], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['resource_type', request.resourceType], ['search', request.search], ), }, unmarshalListLogsResponse, ) - + /** * List logs. List logs available for given Organization. You must define the `organization_id` in the query path of your request. * @@ -1323,7 +1319,6 @@ export class API extends ParentAPI { listLogs = (request: Readonly = {}) => enrichForPagination('logs', this.pageOfListLogs, request) - /** * Get a log. Retrieve information about a log, specified by the `log_id` parameter. The log's full details, including `id`, `ip`, `user_agent`, `action`, `bearer_id`, `resource_type` and `resource_id` are returned in the response. * @@ -1339,14 +1334,15 @@ export class API extends ParentAPI { unmarshalLog, ) - /** * Get security settings of an Organization. Retrieve information about the security settings of an Organization, specified by the `organization_id` parameter. * * @param request - The request {@link GetOrganizationSecuritySettingsRequest} * @returns A Promise of OrganizationSecuritySettings */ - getOrganizationSecuritySettings = (request: Readonly = {}) => + getOrganizationSecuritySettings = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1355,18 +1351,22 @@ export class API extends ParentAPI { unmarshalOrganizationSecuritySettings, ) - /** * Update the security settings of an Organization. * * @param request - The request {@link UpdateOrganizationSecuritySettingsRequest} * @returns A Promise of OrganizationSecuritySettings */ - updateOrganizationSecuritySettings = (request: Readonly = {}) => + updateOrganizationSecuritySettings = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalUpdateOrganizationSecuritySettingsRequest(request, this.client.settings), + marshalUpdateOrganizationSecuritySettingsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1375,7 +1375,6 @@ export class API extends ParentAPI { unmarshalOrganizationSecuritySettings, ) - /** * Set your Organization's alias.. This will fail if an alias has already been defined. Please contact support if you need to change your Organization's alias. * @@ -1395,7 +1394,6 @@ export class API extends ParentAPI { unmarshalOrganization, ) - /** * Get your Organization's IAM information. * @@ -1411,18 +1409,22 @@ export class API extends ParentAPI { unmarshalOrganization, ) - /** * Set your Organization's allowed login methods.. Set your Organization's allowed login methods. * * @param request - The request {@link UpdateOrganizationLoginMethodsRequest} * @returns A Promise of Organization */ - updateOrganizationLoginMethods = (request: Readonly = {}) => + updateOrganizationLoginMethods = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalUpdateOrganizationLoginMethodsRequest(request, this.client.settings), + marshalUpdateOrganizationLoginMethodsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1431,7 +1433,6 @@ export class API extends ParentAPI { unmarshalOrganization, ) - /** * Get SAML Identity Provider configuration of an Organization. * @@ -1447,14 +1448,15 @@ export class API extends ParentAPI { unmarshalSaml, ) - /** * Enable SAML Identity Provider for an Organization. * * @param request - The request {@link EnableOrganizationSamlRequest} * @returns A Promise of Saml */ - enableOrganizationSaml = (request: Readonly = {}) => + enableOrganizationSaml = ( + request: Readonly = {}, + ) => this.client.fetch( { body: '{}', @@ -1465,7 +1467,6 @@ export class API extends ParentAPI { unmarshalSaml, ) - /** * Update SAML Identity Provider configuration. * @@ -1485,21 +1486,17 @@ export class API extends ParentAPI { unmarshalSaml, ) - /** * Disable SAML Identity Provider for an Organization. * * @param request - The request {@link DeleteSamlRequest} */ deleteSaml = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/saml/${validatePathParam('samlId', request.samlId)}`, + }) - /** * Parse SAML xml metadata file. * @@ -1519,7 +1516,6 @@ export class API extends ParentAPI { unmarshalParseSamlMetadataResponse, ) - /** * List SAML certificates. * @@ -1535,7 +1531,6 @@ export class API extends ParentAPI { unmarshalListSamlCertificatesResponse, ) - /** * Add a SAML certificate. * @@ -1555,21 +1550,17 @@ export class API extends ParentAPI { unmarshalSamlCertificate, ) - /** * Delete a SAML certificate. * * @param request - The request {@link DeleteSamlCertificateRequest} */ deleteSamlCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/saml-certificates/${validatePathParam('certificateId', request.certificateId)}`, + }) - /** * Get SCIM configuration of an Organization. * @@ -1585,14 +1576,15 @@ export class API extends ParentAPI { unmarshalScim, ) - /** * Enable SCIM for an Organization. * * @param request - The request {@link EnableOrganizationScimRequest} * @returns A Promise of Scim */ - enableOrganizationScim = (request: Readonly = {}) => + enableOrganizationScim = ( + request: Readonly = {}, + ) => this.client.fetch( { body: '{}', @@ -1603,21 +1595,17 @@ export class API extends ParentAPI { unmarshalScim, ) - /** * Disable SCIM for an Organization. * * @param request - The request {@link DeleteScimRequest} */ deleteScim = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/scim/${validatePathParam('scimId', request.scimId)}`, + }) - protected pageOfListScimTokens = (request: Readonly) => this.client.fetch( { @@ -1626,12 +1614,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListScimTokensResponse, ) - + /** * List SCIM tokens. * @@ -1641,7 +1632,6 @@ export class API extends ParentAPI { listScimTokens = (request: Readonly) => enrichForPagination('scimTokens', this.pageOfListScimTokens, request) - /** * Create a SCIM token. * @@ -1657,20 +1647,14 @@ export class API extends ParentAPI { unmarshalCreateScimTokenResponse, ) - /** * Delete a SCIM token. * * @param request - The request {@link DeleteScimTokenRequest} */ deleteScimToken = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iam/v1alpha1/scim-tokens/${validatePathParam('tokenId', request.tokenId)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/iam/v1alpha1/scim-tokens/${validatePathParam('tokenId', request.tokenId)}`, + }) } - diff --git a/packages_generated/iam/src/v1alpha1/index.gen.ts b/packages_generated/iam/src/v1alpha1/index.gen.ts index a2950c456..74d02d26b 100644 --- a/packages_generated/iam/src/v1alpha1/index.gen.ts +++ b/packages_generated/iam/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { APIKey, diff --git a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts index c1b25db6c..f9d75b94b 100644 --- a/packages_generated/iam/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/iam/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, marshalBlobToScwFile, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + marshalBlobToScwFile, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { JWT, @@ -334,7 +340,9 @@ const unmarshalScimToken = (data: unknown): ScimToken => { } as ScimToken } -export const unmarshalCreateScimTokenResponse = (data: unknown): CreateScimTokenResponse => { +export const unmarshalCreateScimTokenResponse = ( + data: unknown, +): CreateScimTokenResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateScimTokenResponse' failed as data isn't a dictionary.`, @@ -361,7 +369,9 @@ export const unmarshalEncodedJWT = (data: unknown): EncodedJWT => { } as EncodedJWT } -const unmarshalConnectionConnectedOrganization = (data: unknown): ConnectionConnectedOrganization => { +const unmarshalConnectionConnectedOrganization = ( + data: unknown, +): ConnectionConnectedOrganization => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectionConnectedOrganization' failed as data isn't a dictionary.`, @@ -375,7 +385,9 @@ const unmarshalConnectionConnectedOrganization = (data: unknown): ConnectionConn } as ConnectionConnectedOrganization } -const unmarshalConnectionConnectedUser = (data: unknown): ConnectionConnectedUser => { +const unmarshalConnectionConnectedUser = ( + data: unknown, +): ConnectionConnectedUser => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ConnectionConnectedUser' failed as data isn't a dictionary.`, @@ -397,12 +409,16 @@ const unmarshalConnection = (data: unknown): Connection => { } return { - organization: data.organization ? unmarshalConnectionConnectedOrganization(data.organization) : undefined, + organization: data.organization + ? unmarshalConnectionConnectedOrganization(data.organization) + : undefined, user: data.user ? unmarshalConnectionConnectedUser(data.user) : undefined, } as Connection } -export const unmarshalGetUserConnectionsResponse = (data: unknown): GetUserConnectionsResponse => { +export const unmarshalGetUserConnectionsResponse = ( + data: unknown, +): GetUserConnectionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetUserConnectionsResponse' failed as data isn't a dictionary.`, @@ -414,7 +430,9 @@ export const unmarshalGetUserConnectionsResponse = (data: unknown): GetUserConne } as GetUserConnectionsResponse } -export const unmarshalInitiateUserConnectionResponse = (data: unknown): InitiateUserConnectionResponse => { +export const unmarshalInitiateUserConnectionResponse = ( + data: unknown, +): InitiateUserConnectionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'InitiateUserConnectionResponse' failed as data isn't a dictionary.`, @@ -426,7 +444,9 @@ export const unmarshalInitiateUserConnectionResponse = (data: unknown): Initiate } as InitiateUserConnectionResponse } -export const unmarshalListAPIKeysResponse = (data: unknown): ListAPIKeysResponse => { +export const unmarshalListAPIKeysResponse = ( + data: unknown, +): ListAPIKeysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAPIKeysResponse' failed as data isn't a dictionary.`, @@ -439,7 +459,9 @@ export const unmarshalListAPIKeysResponse = (data: unknown): ListAPIKeysResponse } as ListAPIKeysResponse } -export const unmarshalListApplicationsResponse = (data: unknown): ListApplicationsResponse => { +export const unmarshalListApplicationsResponse = ( + data: unknown, +): ListApplicationsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`, @@ -447,7 +469,10 @@ export const unmarshalListApplicationsResponse = (data: unknown): ListApplicatio } return { - applications: unmarshalArrayOfObject(data.applications, unmarshalApplication), + applications: unmarshalArrayOfObject( + data.applications, + unmarshalApplication, + ), totalCount: data.total_count, } as ListApplicationsResponse } @@ -466,7 +491,9 @@ const unmarshalGracePeriod = (data: unknown): GracePeriod => { } as GracePeriod } -export const unmarshalListGracePeriodsResponse = (data: unknown): ListGracePeriodsResponse => { +export const unmarshalListGracePeriodsResponse = ( + data: unknown, +): ListGracePeriodsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGracePeriodsResponse' failed as data isn't a dictionary.`, @@ -474,11 +501,16 @@ export const unmarshalListGracePeriodsResponse = (data: unknown): ListGracePerio } return { - gracePeriods: unmarshalArrayOfObject(data.grace_periods, unmarshalGracePeriod), + gracePeriods: unmarshalArrayOfObject( + data.grace_periods, + unmarshalGracePeriod, + ), } as ListGracePeriodsResponse } -export const unmarshalListGroupsResponse = (data: unknown): ListGroupsResponse => { +export const unmarshalListGroupsResponse = ( + data: unknown, +): ListGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGroupsResponse' failed as data isn't a dictionary.`, @@ -533,7 +565,9 @@ const unmarshalPermissionSet = (data: unknown): PermissionSet => { } as PermissionSet } -export const unmarshalListPermissionSetsResponse = (data: unknown): ListPermissionSetsResponse => { +export const unmarshalListPermissionSetsResponse = ( + data: unknown, +): ListPermissionSetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPermissionSetsResponse' failed as data isn't a dictionary.`, @@ -541,12 +575,17 @@ export const unmarshalListPermissionSetsResponse = (data: unknown): ListPermissi } return { - permissionSets: unmarshalArrayOfObject(data.permission_sets, unmarshalPermissionSet), + permissionSets: unmarshalArrayOfObject( + data.permission_sets, + unmarshalPermissionSet, + ), totalCount: data.total_count, } as ListPermissionSetsResponse } -export const unmarshalListPoliciesResponse = (data: unknown): ListPoliciesResponse => { +export const unmarshalListPoliciesResponse = ( + data: unknown, +): ListPoliciesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPoliciesResponse' failed as data isn't a dictionary.`, @@ -559,7 +598,9 @@ export const unmarshalListPoliciesResponse = (data: unknown): ListPoliciesRespon } as ListPoliciesResponse } -export const unmarshalListQuotaResponse = (data: unknown): ListQuotaResponse => { +export const unmarshalListQuotaResponse = ( + data: unknown, +): ListQuotaResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListQuotaResponse' failed as data isn't a dictionary.`, @@ -590,7 +631,9 @@ const unmarshalRule = (data: unknown): Rule => { } as Rule } -export const unmarshalListRulesResponse = (data: unknown): ListRulesResponse => { +export const unmarshalListRulesResponse = ( + data: unknown, +): ListRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRulesResponse' failed as data isn't a dictionary.`, @@ -603,7 +646,9 @@ export const unmarshalListRulesResponse = (data: unknown): ListRulesResponse => } as ListRulesResponse } -export const unmarshalListSSHKeysResponse = (data: unknown): ListSSHKeysResponse => { +export const unmarshalListSSHKeysResponse = ( + data: unknown, +): ListSSHKeysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSSHKeysResponse' failed as data isn't a dictionary.`, @@ -616,7 +661,9 @@ export const unmarshalListSSHKeysResponse = (data: unknown): ListSSHKeysResponse } as ListSSHKeysResponse } -export const unmarshalListSamlCertificatesResponse = (data: unknown): ListSamlCertificatesResponse => { +export const unmarshalListSamlCertificatesResponse = ( + data: unknown, +): ListSamlCertificatesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSamlCertificatesResponse' failed as data isn't a dictionary.`, @@ -624,11 +671,16 @@ export const unmarshalListSamlCertificatesResponse = (data: unknown): ListSamlCe } return { - certificates: unmarshalArrayOfObject(data.certificates, unmarshalSamlCertificate), + certificates: unmarshalArrayOfObject( + data.certificates, + unmarshalSamlCertificate, + ), } as ListSamlCertificatesResponse } -export const unmarshalListScimTokensResponse = (data: unknown): ListScimTokensResponse => { +export const unmarshalListScimTokensResponse = ( + data: unknown, +): ListScimTokensResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListScimTokensResponse' failed as data isn't a dictionary.`, @@ -641,7 +693,9 @@ export const unmarshalListScimTokensResponse = (data: unknown): ListScimTokensRe } as ListScimTokensResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -684,7 +738,9 @@ export const unmarshalOrganization = (data: unknown): Organization => { } as Organization } -export const unmarshalOrganizationSecuritySettings = (data: unknown): OrganizationSecuritySettings => { +export const unmarshalOrganizationSecuritySettings = ( + data: unknown, +): OrganizationSecuritySettings => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OrganizationSecuritySettings' failed as data isn't a dictionary.`, @@ -700,7 +756,9 @@ export const unmarshalOrganizationSecuritySettings = (data: unknown): Organizati } as OrganizationSecuritySettings } -export const unmarshalParseSamlMetadataResponse = (data: unknown): ParseSamlMetadataResponse => { +export const unmarshalParseSamlMetadataResponse = ( + data: unknown, +): ParseSamlMetadataResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ParseSamlMetadataResponse' failed as data isn't a dictionary.`, @@ -737,7 +795,9 @@ export const unmarshalSaml = (data: unknown): Saml => { return { entityId: data.entity_id, id: data.id, - serviceProvider: data.service_provider ? unmarshalSamlServiceProvider(data.service_provider) : undefined, + serviceProvider: data.service_provider + ? unmarshalSamlServiceProvider(data.service_provider) + : undefined, singleSignOnUrl: data.single_sign_on_url, status: data.status, } as Saml @@ -768,7 +828,9 @@ export const unmarshalSetRulesResponse = (data: unknown): SetRulesResponse => { } as SetRulesResponse } -export const unmarshalValidateUserMFAOTPResponse = (data: unknown): ValidateUserMFAOTPResponse => { +export const unmarshalValidateUserMFAOTPResponse = ( + data: unknown, +): ValidateUserMFAOTPResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ValidateUserMFAOTPResponse' failed as data isn't a dictionary.`, @@ -783,14 +845,10 @@ export const unmarshalValidateUserMFAOTPResponse = (data: unknown): ValidateUser export const marshalAddGroupMemberRequest = ( request: AddGroupMemberRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'user_id', - value: request.userId, - }, - {param: 'application_id', - value: request.applicationId, - }, + { param: 'user_id', value: request.userId }, + { param: 'application_id', value: request.applicationId }, ]), }) @@ -816,14 +874,10 @@ export const marshalCreateAPIKeyRequest = ( ): Record => ({ default_project_id: request.defaultProjectId, description: request.description, - expires_at: request.expiresAt, + expires_at: request.expiresAt, ...resolveOneOf([ - {param: 'application_id', - value: request.applicationId, - }, - {param: 'user_id', - value: request.userId, - }, + { param: 'application_id', value: request.applicationId }, + { param: 'user_id', value: request.userId }, ]), }) @@ -860,14 +914,10 @@ const marshalRuleSpecs = ( defaults: DefaultValues, ): Record => ({ condition: request.condition, - permission_set_names: request.permissionSetNames, + permission_set_names: request.permissionSetNames, ...resolveOneOf([ - {param: 'project_ids', - value: request.projectIds, - }, - {param: 'organization_id', - value: request.organizationId, - }, + { param: 'project_ids', value: request.projectIds }, + { param: 'organization_id', value: request.organizationId }, ]), }) @@ -878,21 +928,16 @@ export const marshalCreatePolicyRequest = ( description: request.description, name: request.name || randomName('pol'), organization_id: request.organizationId ?? defaults.defaultOrganizationId, - rules: ((request.rules !== undefined) ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)): undefined), - tags: request.tags, + rules: + request.rules !== undefined + ? request.rules.map(elt => marshalRuleSpecs(elt, defaults)) + : undefined, + tags: request.tags, ...resolveOneOf([ - {param: 'user_id', - value: request.userId, - }, - {param: 'group_id', - value: request.groupId, - }, - {param: 'application_id', - value: request.applicationId, - }, - {param: 'no_principal', - value: request.noPrincipal, - }, + { param: 'user_id', value: request.userId }, + { param: 'group_id', value: request.groupId }, + { param: 'application_id', value: request.applicationId }, + { param: 'no_principal', value: request.noPrincipal }, ]), }) @@ -925,14 +970,15 @@ export const marshalCreateUserRequest = ( defaults: DefaultValues, ): Record => ({ organization_id: request.organizationId ?? defaults.defaultOrganizationId, - tags: request.tags, + tags: request.tags, ...resolveOneOf>([ - {param: 'email', - value: request.email, - }, - {param: 'member', - value: (request.member !== undefined) ? marshalCreateUserRequestMember(request.member, defaults) - : undefined, + { param: 'email', value: request.email }, + { + param: 'member', + value: + request.member !== undefined + ? marshalCreateUserRequestMember(request.member, defaults) + : undefined, }, ]), }) @@ -948,20 +994,16 @@ export const marshalParseSamlMetadataRequest = async ( request: ParseSamlMetadataRequest, defaults: DefaultValues, ): Promise> => ({ - file: await marshalBlobToScwFile(request.file), + file: await marshalBlobToScwFile(request.file), }) export const marshalRemoveGroupMemberRequest = ( request: RemoveGroupMemberRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'user_id', - value: request.userId, - }, - {param: 'application_id', - value: request.applicationId, - }, + { param: 'user_id', value: request.userId }, + { param: 'application_id', value: request.applicationId }, ]), }) @@ -992,7 +1034,7 @@ export const marshalSetRulesRequest = ( defaults: DefaultValues, ): Record => ({ policy_id: request.policyId, - rules: request.rules.map(elt => marshalRuleSpecs(elt, defaults)), + rules: request.rules.map(elt => marshalRuleSpecs(elt, defaults)), }) export const marshalUpdateAPIKeyRequest = ( @@ -1049,20 +1091,12 @@ export const marshalUpdatePolicyRequest = ( ): Record => ({ description: request.description, name: request.name, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {param: 'user_id', - value: request.userId, - }, - {param: 'group_id', - value: request.groupId, - }, - {param: 'application_id', - value: request.applicationId, - }, - {param: 'no_principal', - value: request.noPrincipal, - }, + { param: 'user_id', value: request.userId }, + { param: 'group_id', value: request.groupId }, + { param: 'application_id', value: request.applicationId }, + { param: 'no_principal', value: request.noPrincipal }, ]), }) diff --git a/packages_generated/iam/src/v1alpha1/types.gen.ts b/packages_generated/iam/src/v1alpha1/types.gen.ts index 852ff0f2e..aa3d7de02 100644 --- a/packages_generated/iam/src/v1alpha1/types.gen.ts +++ b/packages_generated/iam/src/v1alpha1/types.gen.ts @@ -1,12 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' - -export type BearerType = - | 'unknown_bearer_type' - | 'user' - | 'application' +export type BearerType = 'unknown_bearer_type' | 'user' | 'application' export type GracePeriodType = | 'unknown_grace_period_type' @@ -45,9 +41,7 @@ export type ListJWTsRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type ListLogsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListLogsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListPermissionSetsRequestOrderBy = | 'name_asc' @@ -61,9 +55,7 @@ export type ListPoliciesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListQuotaRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListQuotaRequestOrderBy = 'name_asc' | 'name_desc' export type ListSSHKeysRequestOrderBy = | 'created_at_asc' @@ -73,9 +65,7 @@ export type ListSSHKeysRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListScimTokensRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListScimTokensRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListUsersRequestOrderBy = | 'created_at_asc' @@ -89,16 +79,9 @@ export type ListUsersRequestOrderBy = | 'username_asc' | 'username_desc' -export type LocalityType = - | 'global' - | 'region' - | 'zone' +export type LocalityType = 'global' | 'region' | 'zone' -export type LogAction = - | 'unknown_action' - | 'created' - | 'updated' - | 'deleted' +export type LogAction = 'unknown_action' | 'created' | 'updated' | 'deleted' export type LogResourceType = | 'unknown_resource_type' @@ -131,15 +114,9 @@ export type SamlStatus = | 'missing_entity_id' | 'missing_single_sign_on_url' -export type UserStatus = - | 'unknown_status' - | 'invitation_pending' - | 'activated' +export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated' -export type UserType = - | 'unknown_type' - | 'owner' - | 'member' +export type UserType = 'unknown_type' | 'owner' | 'member' export interface ConnectionConnectedOrganization { id: string @@ -147,14 +124,12 @@ export interface ConnectionConnectedOrganization { locked: boolean } - export interface ConnectionConnectedUser { id: string username: string type: UserType } - export interface QuotumLimit { /** * Whether or not the limit is applied globally. @@ -188,7 +163,6 @@ export interface QuotumLimit { unlimited?: boolean } - export interface JWT { /** * JWT ID. @@ -224,7 +198,6 @@ export interface JWT { userAgent: string } - export interface RuleSpecs { /** * Names of permission sets bound to the rule. @@ -248,7 +221,6 @@ export interface RuleSpecs { organizationId?: string } - export interface ScimToken { id: string scimId: string @@ -256,7 +228,6 @@ export interface ScimToken { expiresAt?: Date } - export interface CreateUserRequestMember { /** * Email of the user to create. @@ -296,7 +267,6 @@ export interface CreateUserRequestMember { locale: string } - export interface Connection { /** * Information about the connected organization. @@ -308,7 +278,6 @@ export interface Connection { user?: ConnectionConnectedUser } - export interface APIKey { /** * Access key of the API key. @@ -368,7 +337,6 @@ export interface APIKey { creationIp: string } - export interface Application { /** * ID of the application. @@ -416,7 +384,6 @@ export interface Application { tags: string[] } - export interface GracePeriod { /** * Type of grace period. @@ -432,7 +399,6 @@ export interface GracePeriod { expiresAt?: Date } - export interface Group { /** * ID of the group. @@ -484,7 +450,6 @@ export interface Group { managed: boolean } - export interface Log { /** * Log ID. @@ -524,7 +489,6 @@ export interface Log { resourceId: string } - export interface PermissionSet { /** * Id of the permission set. @@ -548,7 +512,6 @@ export interface PermissionSet { categories?: string[] } - export interface Policy { /** * Id of the policy. @@ -628,7 +591,6 @@ export interface Policy { noPrincipal?: boolean } - export interface Quotum { /** * Name of the quota. @@ -668,7 +630,6 @@ export interface Quotum { limits: QuotumLimit[] } - export interface Rule { /** * Id of rule. @@ -706,7 +667,6 @@ export interface Rule { accountRootUserId?: string } - export interface SSHKey { /** * ID of SSH key. @@ -746,7 +706,6 @@ export interface SSHKey { disabled: boolean } - export interface SamlCertificate { /** * ID of the SAML certificate. @@ -770,7 +729,6 @@ export interface SamlCertificate { expiresAt?: Date } - export interface User { /** * ID of user. @@ -850,13 +808,11 @@ export interface User { locked: boolean } - export interface SamlServiceProvider { entityId: string assertionConsumerServiceUrl: string } - export type AddGroupMemberRequest = { /** * ID of the group. @@ -876,7 +832,6 @@ export type AddGroupMemberRequest = { applicationId?: string } - export type AddGroupMembersRequest = { /** * ID of the group. @@ -892,7 +847,6 @@ export type AddGroupMembersRequest = { applicationIds?: string[] } - export type AddSamlCertificateRequest = { /** * ID of the SAML configuration. @@ -908,12 +862,10 @@ export type AddSamlCertificateRequest = { content: string } - export type ClonePolicyRequest = { policyId: string } - export type CreateAPIKeyRequest = { /** * ID of the application. @@ -941,7 +893,6 @@ export type CreateAPIKeyRequest = { description: string } - export type CreateApplicationRequest = { /** * Name of the application to create (max length is 64 characters). @@ -961,7 +912,6 @@ export type CreateApplicationRequest = { tags?: string[] } - export type CreateGroupRequest = { /** * ID of Organization linked to the group. @@ -981,7 +931,6 @@ export type CreateGroupRequest = { tags?: string[] } - export type CreateJWTRequest = { /** * ID of the user the JWT will be created for. @@ -993,7 +942,6 @@ export type CreateJWTRequest = { referrer: string } - export type CreatePolicyRequest = { /** * Name of the policy to create (max length is 64 characters). @@ -1041,7 +989,6 @@ export type CreatePolicyRequest = { noPrincipal?: boolean } - export type CreateSSHKeyRequest = { /** * Name of the SSH key. Max length is 1000. @@ -1057,7 +1004,6 @@ export type CreateSSHKeyRequest = { projectId?: string } - export type CreateScimTokenRequest = { /** * ID of the SCIM configuration. @@ -1065,7 +1011,6 @@ export type CreateScimTokenRequest = { scimId: string } - export interface CreateScimTokenResponse { /** * The SCIM token metadata. @@ -1077,7 +1022,6 @@ export interface CreateScimTokenResponse { bearerToken: string } - export type CreateUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -1085,7 +1029,6 @@ export type CreateUserMFAOTPRequest = { userId: string } - export type CreateUserRequest = { /** * ID of the Organization. @@ -1109,7 +1052,6 @@ export type CreateUserRequest = { member?: CreateUserRequestMember } - export type DeleteAPIKeyRequest = { /** * Access key to delete. @@ -1117,7 +1059,6 @@ export type DeleteAPIKeyRequest = { accessKey: string } - export type DeleteApplicationRequest = { /** * ID of the application to delete. @@ -1125,7 +1066,6 @@ export type DeleteApplicationRequest = { applicationId: string } - export type DeleteGroupRequest = { /** * ID of the group to delete. @@ -1133,7 +1073,6 @@ export type DeleteGroupRequest = { groupId: string } - export type DeleteJWTRequest = { /** * JWT ID of the JWT to delete. @@ -1141,7 +1080,6 @@ export type DeleteJWTRequest = { jti: string } - export type DeletePolicyRequest = { /** * Id of policy to delete. @@ -1149,12 +1087,10 @@ export type DeletePolicyRequest = { policyId: string } - export type DeleteSSHKeyRequest = { sshKeyId: string } - export type DeleteSamlCertificateRequest = { /** * ID of the certificate to delete. @@ -1162,7 +1098,6 @@ export type DeleteSamlCertificateRequest = { certificateId: string } - export type DeleteSamlRequest = { /** * ID of the SAML configuration. @@ -1170,7 +1105,6 @@ export type DeleteSamlRequest = { samlId: string } - export type DeleteScimRequest = { /** * ID of the SCIM configuration. @@ -1178,7 +1112,6 @@ export type DeleteScimRequest = { scimId: string } - export type DeleteScimTokenRequest = { /** * The SCIM token ID. @@ -1186,7 +1119,6 @@ export type DeleteScimTokenRequest = { tokenId: string } - export type DeleteUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -1194,7 +1126,6 @@ export type DeleteUserMFAOTPRequest = { userId: string } - export type DeleteUserRequest = { /** * ID of the user to delete. @@ -1202,7 +1133,6 @@ export type DeleteUserRequest = { userId: string } - export type EnableOrganizationSamlRequest = { /** * ID of the Organization. @@ -1210,7 +1140,6 @@ export type EnableOrganizationSamlRequest = { organizationId?: string } - export type EnableOrganizationScimRequest = { /** * ID of the Organization. @@ -1218,7 +1147,6 @@ export type EnableOrganizationScimRequest = { organizationId?: string } - export interface EncodedJWT { /** * The renewed JWT. @@ -1234,7 +1162,6 @@ export interface EncodedJWT { renewToken: string } - export type GetAPIKeyRequest = { /** * Access key to search for. @@ -1242,7 +1169,6 @@ export type GetAPIKeyRequest = { accessKey: string } - export type GetApplicationRequest = { /** * ID of the application to find. @@ -1250,7 +1176,6 @@ export type GetApplicationRequest = { applicationId: string } - export type GetGroupRequest = { /** * ID of the group. @@ -1258,7 +1183,6 @@ export type GetGroupRequest = { groupId: string } - export type GetJWTRequest = { /** * JWT ID of the JWT to get. @@ -1266,7 +1190,6 @@ export type GetJWTRequest = { jti: string } - export type GetLogRequest = { /** * ID of the log. @@ -1274,7 +1197,6 @@ export type GetLogRequest = { logId: string } - export type GetOrganizationRequest = { /** * ID of the Organization. @@ -1282,7 +1204,6 @@ export type GetOrganizationRequest = { organizationId?: string } - export type GetOrganizationSamlRequest = { /** * ID of the Organization. @@ -1290,12 +1211,10 @@ export type GetOrganizationSamlRequest = { organizationId?: string } - export type GetOrganizationScimRequest = { organizationId?: string } - export type GetOrganizationSecuritySettingsRequest = { /** * ID of the Organization. @@ -1303,7 +1222,6 @@ export type GetOrganizationSecuritySettingsRequest = { organizationId?: string } - export type GetPolicyRequest = { /** * Id of policy to search. @@ -1311,7 +1229,6 @@ export type GetPolicyRequest = { policyId: string } - export type GetQuotumRequest = { /** * Name of the quota to get. @@ -1323,7 +1240,6 @@ export type GetQuotumRequest = { organizationId?: string } - export type GetSSHKeyRequest = { /** * ID of the SSH key. @@ -1331,7 +1247,6 @@ export type GetSSHKeyRequest = { sshKeyId: string } - export type GetUserConnectionsRequest = { /** * ID of the user to list connections for. @@ -1339,7 +1254,6 @@ export type GetUserConnectionsRequest = { userId: string } - export interface GetUserConnectionsResponse { /** * List of connections. @@ -1347,7 +1261,6 @@ export interface GetUserConnectionsResponse { connections: Connection[] } - export type GetUserRequest = { /** * ID of the user to find. @@ -1355,7 +1268,6 @@ export type GetUserRequest = { userId: string } - export type InitiateUserConnectionRequest = { /** * ID of the user that will be added to your connection. @@ -1363,7 +1275,6 @@ export type InitiateUserConnectionRequest = { userId: string } - export interface InitiateUserConnectionResponse { /** * Token to be used in JoinUserConnection. @@ -1371,7 +1282,6 @@ export interface InitiateUserConnectionResponse { token: string } - export type JoinUserConnectionRequest = { /** * User ID. @@ -1383,7 +1293,6 @@ export type JoinUserConnectionRequest = { token: string } - export type ListAPIKeysRequest = { /** * Criteria for sorting results. @@ -1443,7 +1352,6 @@ export type ListAPIKeysRequest = { accessKeys?: string[] } - export interface ListAPIKeysResponse { /** * List of API keys. @@ -1455,7 +1363,6 @@ export interface ListAPIKeysResponse { totalCount: number } - export type ListApplicationsRequest = { /** * Criteria for sorting results. @@ -1491,7 +1398,6 @@ export type ListApplicationsRequest = { tag?: string } - export interface ListApplicationsResponse { /** * List of applications. @@ -1503,7 +1409,6 @@ export interface ListApplicationsResponse { totalCount: number } - export type ListGracePeriodsRequest = { /** * ID of the user to list grace periods for. @@ -1511,7 +1416,6 @@ export type ListGracePeriodsRequest = { userId?: string } - export interface ListGracePeriodsResponse { /** * List of grace periods. @@ -1519,7 +1423,6 @@ export interface ListGracePeriodsResponse { gracePeriods: GracePeriod[] } - export type ListGroupsRequest = { /** * Sort order of groups. @@ -1559,7 +1462,6 @@ export type ListGroupsRequest = { tag?: string } - export interface ListGroupsResponse { /** * List of groups. @@ -1571,7 +1473,6 @@ export interface ListGroupsResponse { totalCount: number } - export type ListJWTsRequest = { /** * Criteria for sorting results. @@ -1595,13 +1496,11 @@ export type ListJWTsRequest = { expired?: boolean } - export interface ListJWTsResponse { jwts: JWT[] totalCount: number } - export type ListLogsRequest = { /** * Criteria for sorting results. @@ -1641,7 +1540,6 @@ export type ListLogsRequest = { search?: string } - export interface ListLogsResponse { /** * List of logs. @@ -1653,7 +1551,6 @@ export interface ListLogsResponse { totalCount: number } - export type ListPermissionSetsRequest = { /** * Criteria for sorting results. @@ -1673,7 +1570,6 @@ export type ListPermissionSetsRequest = { organizationId?: string } - export interface ListPermissionSetsResponse { /** * List of permission sets. @@ -1685,7 +1581,6 @@ export interface ListPermissionSetsResponse { totalCount: number } - export type ListPoliciesRequest = { /** * Criteria for sorting results. @@ -1737,7 +1632,6 @@ export type ListPoliciesRequest = { policyIds?: string[] } - export interface ListPoliciesResponse { /** * List of policies. @@ -1749,7 +1643,6 @@ export interface ListPoliciesResponse { totalCount: number } - export type ListQuotaRequest = { /** * Criteria for sorting results. @@ -1773,7 +1666,6 @@ export type ListQuotaRequest = { quotumNames?: string[] } - export interface ListQuotaResponse { /** * List of quota. @@ -1785,7 +1677,6 @@ export interface ListQuotaResponse { totalCount: number } - export type ListRulesRequest = { /** * Id of policy to search. @@ -1801,7 +1692,6 @@ export type ListRulesRequest = { page?: number } - export interface ListRulesResponse { /** * Rules of the policy. @@ -1813,7 +1703,6 @@ export interface ListRulesResponse { totalCount: number } - export type ListSSHKeysRequest = { /** * Sort order of the SSH keys. @@ -1845,7 +1734,6 @@ export type ListSSHKeysRequest = { disabled?: boolean } - export interface ListSSHKeysResponse { /** * List of SSH keys. @@ -1857,7 +1745,6 @@ export interface ListSSHKeysResponse { totalCount: number } - export type ListSamlCertificatesRequest = { /** * ID of the SAML configuration. @@ -1865,7 +1752,6 @@ export type ListSamlCertificatesRequest = { samlId: string } - export interface ListSamlCertificatesResponse { /** * List of SAML certificates. @@ -1873,7 +1759,6 @@ export interface ListSamlCertificatesResponse { certificates: SamlCertificate[] } - export type ListScimTokensRequest = { /** * ID of the SCIM configuration. @@ -1893,7 +1778,6 @@ export type ListScimTokensRequest = { pageSize?: number } - export interface ListScimTokensResponse { /** * List of SCIM tokens. @@ -1905,7 +1789,6 @@ export interface ListScimTokensResponse { totalCount: number } - export type ListUsersRequest = { /** * Criteria for sorting results. @@ -1941,7 +1824,6 @@ export type ListUsersRequest = { type?: UserType } - export interface ListUsersResponse { /** * List of users. @@ -1953,7 +1835,6 @@ export interface ListUsersResponse { totalCount: number } - export type LockUserRequest = { /** * ID of the user to lock. @@ -1961,12 +1842,10 @@ export type LockUserRequest = { userId: string } - export interface MFAOTP { secret: string } - export interface Organization { /** * ID of the Organization. @@ -1998,7 +1877,6 @@ export interface Organization { loginSamlEnabled: boolean } - export interface OrganizationSecuritySettings { /** * Defines whether password renewal is enforced during first login. @@ -2022,19 +1900,16 @@ export interface OrganizationSecuritySettings { maxApiKeyExpirationDuration?: string } - export type ParseSamlMetadataRequest = { file: Blob } - export interface ParseSamlMetadataResponse { singleSignOnUrl: string entityId: string signingCertificates: string[] } - export type RemoveGroupMemberRequest = { /** * ID of the group. @@ -2054,7 +1929,6 @@ export type RemoveGroupMemberRequest = { applicationId?: string } - export type RemoveUserConnectionRequest = { /** * ID of the user you want to manage the connection for. @@ -2066,7 +1940,6 @@ export type RemoveUserConnectionRequest = { targetUserId: string } - export interface Saml { /** * ID of the SAML configuration. @@ -2090,7 +1963,6 @@ export interface Saml { singleSignOnUrl: string } - export interface Scim { /** * ID of the SCIM configuration. @@ -2102,14 +1974,12 @@ export interface Scim { createdAt?: Date } - export type SetGroupMembersRequest = { groupId: string userIds: string[] applicationIds: string[] } - export type SetOrganizationAliasRequest = { /** * ID of the Organization. @@ -2121,7 +1991,6 @@ export type SetOrganizationAliasRequest = { alias: string } - export type SetRulesRequest = { /** * Id of policy to update. @@ -2133,7 +2002,6 @@ export type SetRulesRequest = { rules: RuleSpecs[] } - export interface SetRulesResponse { /** * Rules of the policy. @@ -2141,7 +2009,6 @@ export interface SetRulesResponse { rules: Rule[] } - export type UnlockUserRequest = { /** * ID of the user to unlock. @@ -2149,7 +2016,6 @@ export type UnlockUserRequest = { userId: string } - export type UpdateAPIKeyRequest = { /** * Access key to update. @@ -2169,7 +2035,6 @@ export type UpdateAPIKeyRequest = { expiresAt?: Date } - export type UpdateApplicationRequest = { /** * ID of the application to update. @@ -2189,7 +2054,6 @@ export type UpdateApplicationRequest = { tags?: string[] } - export type UpdateGroupRequest = { /** * ID of the group to update. @@ -2209,7 +2073,6 @@ export type UpdateGroupRequest = { tags?: string[] } - export type UpdateOrganizationLoginMethodsRequest = { /** * ID of the Organization. @@ -2233,7 +2096,6 @@ export type UpdateOrganizationLoginMethodsRequest = { loginSamlEnabled?: boolean } - export type UpdateOrganizationSecuritySettingsRequest = { /** * ID of the Organization. @@ -2261,7 +2123,6 @@ export type UpdateOrganizationSecuritySettingsRequest = { maxApiKeyExpirationDuration?: string } - export type UpdatePolicyRequest = { /** * Id of policy to update. @@ -2305,7 +2166,6 @@ export type UpdatePolicyRequest = { noPrincipal?: boolean } - export type UpdateSSHKeyRequest = { sshKeyId: string /** @@ -2318,7 +2178,6 @@ export type UpdateSSHKeyRequest = { disabled?: boolean } - export type UpdateSamlRequest = { /** * ID of the SAML configuration. @@ -2334,7 +2193,6 @@ export type UpdateSamlRequest = { singleSignOnUrl?: string } - export type UpdateUserPasswordRequest = { /** * ID of the user to update. @@ -2346,7 +2204,6 @@ export type UpdateUserPasswordRequest = { password: string } - export type UpdateUserRequest = { /** * ID of the user to update. @@ -2378,7 +2235,6 @@ export type UpdateUserRequest = { locale?: string } - export type UpdateUserUsernameRequest = { /** * ID of the user to update. @@ -2390,7 +2246,6 @@ export type UpdateUserUsernameRequest = { username: string } - export type ValidateUserMFAOTPRequest = { /** * User ID of the MFA OTP. @@ -2402,12 +2257,9 @@ export type ValidateUserMFAOTPRequest = { oneTimePassword: string } - export interface ValidateUserMFAOTPResponse { /** * List of recovery codes usable for this OTP method. */ recoveryCodes: string[] } - - diff --git a/packages_generated/inference/src/v1/api.gen.ts b/packages_generated/inference/src/v1/api.gen.ts index fb8c43931..b75025e33 100644 --- a/packages_generated/inference/src/v1/api.gen.ts +++ b/packages_generated/inference/src/v1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DEPLOYMENT_TRANSIENT_STATUSES as DEPLOYMENT_TRANSIENT_STATUSES_INFERENCE,MODEL_TRANSIENT_STATUSES as MODEL_TRANSIENT_STATUSES_INFERENCE,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + DEPLOYMENT_TRANSIENT_STATUSES as DEPLOYMENT_TRANSIENT_STATUSES_INFERENCE, + MODEL_TRANSIENT_STATUSES as MODEL_TRANSIENT_STATUSES_INFERENCE, +} from './content.gen.js' import { marshalCreateDeploymentRequest, marshalCreateEndpointRequest, @@ -60,14 +63,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - - protected pageOfListDeployments = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + + protected pageOfListDeployments = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -77,14 +79,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListDeploymentsResponse, ) - + /** * List inference deployments. List all your inference deployments. * @@ -94,7 +99,6 @@ export class API extends ParentAPI { listDeployments = (request: Readonly = {}) => enrichForPagination('deployments', this.pageOfListDeployments, request) - /** * Get a deployment. Get the deployment for the given ID. * @@ -109,7 +113,7 @@ export class API extends ParentAPI { }, unmarshalDeployment, ) - + /** * Waits for {@link Deployment} to be in a final state. * @@ -122,13 +126,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DEPLOYMENT_TRANSIENT_STATUSES_INFERENCE.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DEPLOYMENT_TRANSIENT_STATUSES_INFERENCE.includes(res.status), + )), this.getDeployment, request, options, ) - /** * Create a deployment. Create a new inference deployment related to a specific model. * @@ -148,7 +155,6 @@ export class API extends ParentAPI { unmarshalDeployment, ) - /** * Update a deployment. Update an existing inference deployment. * @@ -168,7 +174,6 @@ export class API extends ParentAPI { unmarshalDeployment, ) - /** * Delete a deployment. Delete an existing inference deployment. * @@ -184,7 +189,6 @@ export class API extends ParentAPI { unmarshalDeployment, ) - /** * Get the CA certificate. Get the CA certificate used for the deployment of private endpoints. The CA certificate will be returned as a PEM file. @@ -192,19 +196,16 @@ The CA certificate will be returned as a PEM file. * @param request - The request {@link GetDeploymentCertificateRequest} * @returns A Promise of Blob */ - getDeploymentCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + getDeploymentCertificate = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'GET', + path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/deployments/${validatePathParam('deploymentId', request.deploymentId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Create an endpoint. Create a new Endpoint related to a specific deployment. * @@ -224,7 +225,6 @@ The CA certificate will be returned as a PEM file. unmarshalEndpoint, ) - /** * Update an endpoint. Update an existing Endpoint. * @@ -244,21 +244,17 @@ The CA certificate will be returned as a PEM file. unmarshalEndpoint, ) - /** * Delete an endpoint. Delete an existing Endpoint. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - protected pageOfListModels = (request: Readonly = {}) => this.client.fetch( { @@ -268,14 +264,17 @@ The CA certificate will be returned as a PEM file. ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListModelsResponse, ) - + /** * List models. List all available models. * @@ -285,7 +284,6 @@ The CA certificate will be returned as a PEM file. listModels = (request: Readonly = {}) => enrichForPagination('models', this.pageOfListModels, request) - /** * Get a model. Get the model for the given ID. * @@ -300,7 +298,7 @@ The CA certificate will be returned as a PEM file. }, unmarshalModel, ) - + /** * Waits for {@link Model} to be in a final state. * @@ -313,13 +311,16 @@ The CA certificate will be returned as a PEM file. options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!MODEL_TRANSIENT_STATUSES_INFERENCE.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !MODEL_TRANSIENT_STATUSES_INFERENCE.includes(res.status), + )), this.getModel, request, options, ) - /** * Import a model. Import a new model to your model library. * @@ -339,21 +340,17 @@ The CA certificate will be returned as a PEM file. unmarshalModel, ) - /** * Delete a model. Delete an existing model from your model library. * * @param request - The request {@link DeleteModelRequest} */ deleteModel = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam('modelId', request.modelId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/inference/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/models/${validatePathParam('modelId', request.modelId)}`, + }) - protected pageOfListNodeTypes = (request: Readonly) => this.client.fetch( { @@ -362,12 +359,15 @@ The CA certificate will be returned as a PEM file. urlParams: urlParams( ['include_disabled_types', request.includeDisabledTypes], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -376,7 +376,4 @@ The CA certificate will be returned as a PEM file. */ listNodeTypes = (request: Readonly) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - } - diff --git a/packages_generated/inference/src/v1/content.gen.ts b/packages_generated/inference/src/v1/content.gen.ts index e69e89e29..7870b14cd 100644 --- a/packages_generated/inference/src/v1/content.gen.ts +++ b/packages_generated/inference/src/v1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - DeploymentStatus, - ModelStatus, -} from './types.gen.js' - +import type { DeploymentStatus, ModelStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link DeploymentStatus}. */ export const DEPLOYMENT_TRANSIENT_STATUSES: DeploymentStatus[] = [ @@ -19,4 +15,3 @@ export const MODEL_TRANSIENT_STATUSES: ModelStatus[] = [ 'preparing', 'downloading', ] - diff --git a/packages_generated/inference/src/v1/index.gen.ts b/packages_generated/inference/src/v1/index.gen.ts index cb1c2b3fb..4890a0139 100644 --- a/packages_generated/inference/src/v1/index.gen.ts +++ b/packages_generated/inference/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/inference/src/v1/marshalling.gen.ts b/packages_generated/inference/src/v1/marshalling.gen.ts index 7c65804e6..828b5583b 100644 --- a/packages_generated/inference/src/v1/marshalling.gen.ts +++ b/packages_generated/inference/src/v1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointPrivateNetworkDetails, @@ -26,7 +31,9 @@ import type { UpdateEndpointRequest, } from './types.gen.js' -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -38,15 +45,16 @@ const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateN } as EndpointPrivateNetworkDetails } -const unmarshalEndpointPublicNetworkDetails = (data: unknown): EndpointPublicNetworkDetails => { +const unmarshalEndpointPublicNetworkDetails = ( + data: unknown, +): EndpointPublicNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointPublicNetworkDetails + return {} as EndpointPublicNetworkDetails } export const unmarshalEndpoint = (data: unknown): Endpoint => { @@ -59,13 +67,19 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { return { disableAuth: data.disable_auth, id: data.id, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, - publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, + publicNetwork: data.public_network + ? unmarshalEndpointPublicNetworkDetails(data.public_network) + : undefined, url: data.url, } as Endpoint } -const unmarshalDeploymentQuantization = (data: unknown): DeploymentQuantization => { +const unmarshalDeploymentQuantization = ( + data: unknown, +): DeploymentQuantization => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeploymentQuantization' failed as data isn't a dictionary.`, @@ -96,7 +110,9 @@ export const unmarshalDeployment = (data: unknown): Deployment => { name: data.name, nodeTypeName: data.node_type_name, projectId: data.project_id, - quantization: data.quantization ? unmarshalDeploymentQuantization(data.quantization) : undefined, + quantization: data.quantization + ? unmarshalDeploymentQuantization(data.quantization) + : undefined, region: data.region, size: data.size, status: data.status, @@ -105,7 +121,9 @@ export const unmarshalDeployment = (data: unknown): Deployment => { } as Deployment } -const unmarshalModelSupportedQuantization = (data: unknown): ModelSupportedQuantization => { +const unmarshalModelSupportedQuantization = ( + data: unknown, +): ModelSupportedQuantization => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ModelSupportedQuantization' failed as data isn't a dictionary.`, @@ -128,7 +146,10 @@ const unmarshalModelSupportedNode = (data: unknown): ModelSupportedNode => { return { nodeTypeName: data.node_type_name, - quantizations: unmarshalArrayOfObject(data.quantizations, unmarshalModelSupportedQuantization), + quantizations: unmarshalArrayOfObject( + data.quantizations, + unmarshalModelSupportedQuantization, + ), } as ModelSupportedNode } @@ -158,7 +179,10 @@ export const unmarshalModel = (data: unknown): Model => { hasEula: data.has_eula, id: data.id, name: data.name, - nodesSupport: unmarshalArrayOfObject(data.nodes_support, unmarshalModelSupportInfo), + nodesSupport: unmarshalArrayOfObject( + data.nodes_support, + unmarshalModelSupportInfo, + ), parameterSizeBits: data.parameter_size_bits, projectId: data.project_id, region: data.region, @@ -169,7 +193,9 @@ export const unmarshalModel = (data: unknown): Model => { } as Model } -export const unmarshalListDeploymentsResponse = (data: unknown): ListDeploymentsResponse => { +export const unmarshalListDeploymentsResponse = ( + data: unknown, +): ListDeploymentsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDeploymentsResponse' failed as data isn't a dictionary.`, @@ -182,7 +208,9 @@ export const unmarshalListDeploymentsResponse = (data: unknown): ListDeployments } as ListDeploymentsResponse } -export const unmarshalListModelsResponse = (data: unknown): ListModelsResponse => { +export const unmarshalListModelsResponse = ( + data: unknown, +): ListModelsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`, @@ -218,7 +246,9 @@ const unmarshalNodeType = (data: unknown): NodeType => { } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -241,8 +271,7 @@ const marshalEndpointPrivateNetworkDetails = ( const marshalEndpointPublicNetworkDetails = ( request: EndpointPublicNetworkDetails, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalDeploymentQuantization = ( request: DeploymentQuantization, @@ -255,15 +284,24 @@ const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, ): Record => ({ - disable_auth: request.disableAuth, + disable_auth: request.disableAuth, ...resolveOneOf([ - {param: 'public_network', - value: (request.publicNetwork !== undefined) ? marshalEndpointPublicNetworkDetails(request.publicNetwork, defaults) - : undefined, + { + param: 'public_network', + value: + request.publicNetwork !== undefined + ? marshalEndpointPublicNetworkDetails(request.publicNetwork, defaults) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointPrivateNetworkDetails(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointPrivateNetworkDetails( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -273,14 +311,17 @@ export const marshalCreateDeploymentRequest = ( defaults: DefaultValues, ): Record => ({ accept_eula: request.acceptEula, - endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), + endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), max_size: request.maxSize, min_size: request.minSize, model_id: request.modelId, name: request.name || randomName('inference'), node_type_name: request.nodeTypeName, project_id: request.projectId ?? defaults.defaultProjectId, - quantization: ((request.quantization !== undefined) ? marshalDeploymentQuantization(request.quantization, defaults): undefined), + quantization: + request.quantization !== undefined + ? marshalDeploymentQuantization(request.quantization, defaults) + : undefined, tags: request.tags, }) @@ -289,19 +330,15 @@ export const marshalCreateEndpointRequest = ( defaults: DefaultValues, ): Record => ({ deployment_id: request.deploymentId, - endpoint: marshalEndpointSpec(request.endpoint, defaults), + endpoint: marshalEndpointSpec(request.endpoint, defaults), }) const marshalModelSource = ( request: ModelSource, defaults: DefaultValues, ): Record => ({ - url: request.url, - ...resolveOneOf([ - {param: 'secret', - value: request.secret, - }, - ]), + url: request.url, + ...resolveOneOf([{ param: 'secret', value: request.secret }]), }) export const marshalCreateModelRequest = ( @@ -310,7 +347,7 @@ export const marshalCreateModelRequest = ( ): Record => ({ name: request.name || randomName('model'), project_id: request.projectId ?? defaults.defaultProjectId, - source: marshalModelSource(request.source, defaults), + source: marshalModelSource(request.source, defaults), }) export const marshalUpdateDeploymentRequest = ( @@ -321,7 +358,10 @@ export const marshalUpdateDeploymentRequest = ( min_size: request.minSize, model_id: request.modelId, name: request.name, - quantization: ((request.quantization !== undefined) ? marshalDeploymentQuantization(request.quantization, defaults): undefined), + quantization: + request.quantization !== undefined + ? marshalDeploymentQuantization(request.quantization, defaults) + : undefined, tags: request.tags, }) diff --git a/packages_generated/inference/src/v1/types.gen.ts b/packages_generated/inference/src/v1/types.gen.ts index bb1e0c167..2c9b447c5 100644 --- a/packages_generated/inference/src/v1/types.gen.ts +++ b/packages_generated/inference/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type DeploymentStatus = | 'unknown_status' @@ -54,15 +53,11 @@ export interface ModelSupportedQuantization { maxContextSize: number } - export interface EndpointPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointPublicNetworkDetails { -} - +export interface EndpointPublicNetworkDetails {} export interface ModelSupportedNode { /** @@ -75,7 +70,6 @@ export interface ModelSupportedNode { quantizations: ModelSupportedQuantization[] } - export interface DeploymentQuantization { /** * The number of bits each model parameter should be quantized to. The quantization method is chosen based on this value. @@ -83,7 +77,6 @@ export interface DeploymentQuantization { bits: number } - export interface Endpoint { /** * Unique identifier. @@ -113,7 +106,6 @@ This CA certificate can be retrieved using the `GetDeploymentCertificate` API ca disableAuth: boolean } - export interface ModelSupportInfo { /** * List of supported node types. @@ -121,7 +113,6 @@ export interface ModelSupportInfo { nodes: ModelSupportedNode[] } - export interface EndpointSpec { /** * Set the endpoint as public. @@ -142,7 +133,6 @@ When setting this field to true, the authentication will be disabled. disableAuth: boolean } - export interface ModelSource { url: string /** @@ -152,7 +142,6 @@ export interface ModelSource { secret?: string } - export interface Deployment { /** * Unique identifier. @@ -224,7 +213,6 @@ export interface Deployment { region: ScwRegion } - export interface Model { /** * Unique identifier. @@ -284,7 +272,6 @@ export interface Model { sizeBytes: number } - export interface NodeType { /** * Name of the node type. @@ -336,7 +323,6 @@ export interface NodeType { region: ScwRegion } - export type CreateDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -385,7 +371,6 @@ The terms of the EULA can be retrieved using the `GetModelEula` API call. quantization?: DeploymentQuantization } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -401,7 +386,6 @@ export type CreateEndpointRequest = { endpoint: EndpointSpec } - export type CreateModelRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -421,7 +405,6 @@ export type CreateModelRequest = { source: ModelSource } - export type DeleteDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -433,7 +416,6 @@ export type DeleteDeploymentRequest = { deploymentId: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -445,7 +427,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type DeleteModelRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -457,7 +438,6 @@ export type DeleteModelRequest = { modelId: string } - export type GetDeploymentCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -466,7 +446,6 @@ export type GetDeploymentCertificateRequest = { deploymentId: string } - export type GetDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -478,7 +457,6 @@ export type GetDeploymentRequest = { deploymentId: string } - export type GetModelRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -490,7 +468,6 @@ export type GetModelRequest = { modelId: string } - export type ListDeploymentsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -526,7 +503,6 @@ export type ListDeploymentsRequest = { tags?: string[] } - export interface ListDeploymentsResponse { /** * List of deployments on the current page. @@ -538,7 +514,6 @@ export interface ListDeploymentsResponse { totalCount: number } - export type ListModelsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -570,7 +545,6 @@ export type ListModelsRequest = { tags?: string[] } - export interface ListModelsResponse { /** * List of models on the current page. @@ -582,7 +556,6 @@ export interface ListModelsResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -602,7 +575,6 @@ export type ListNodeTypesRequest = { includeDisabledTypes: boolean } - export interface ListNodeTypesResponse { /** * List of node types. @@ -614,7 +586,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type UpdateDeploymentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -650,7 +621,6 @@ export type UpdateDeploymentRequest = { quantization?: DeploymentQuantization } - export type UpdateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -666,5 +636,3 @@ When setting this field to true, the authentication will be disabled. */ disableAuth?: boolean } - - diff --git a/packages_generated/instance/src/v1/api.gen.ts b/packages_generated/instance/src/v1/api.gen.ts index 6d30a3e85..a9e0e1f9b 100644 --- a/packages_generated/instance/src/v1/api.gen.ts +++ b/packages_generated/instance/src/v1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalApplyBlockMigrationRequest, marshalAttachServerFileSystemRequest, @@ -259,28 +259,29 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'fr-par-3', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'fr-par-3', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + /** * Get availability. Get availability for all Instance types. * * @param request - The request {@link GetServerTypesAvailabilityRequest} * @returns A Promise of GetServerTypesAvailabilityResponse */ - getServerTypesAvailability = (request: Readonly = {}) => + getServerTypesAvailability = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -293,7 +294,6 @@ export class API extends ParentAPI { unmarshalGetServerTypesAvailabilityResponse, ) - /** * List Instance types. List available Instance types and their technical details. * @@ -313,7 +313,6 @@ export class API extends ParentAPI { unmarshalListServersTypesResponse, ) - /** * List volume types. List all volume types and their technical details. * @@ -333,7 +332,6 @@ export class API extends ParentAPI { unmarshalListVolumesTypesResponse, ) - protected pageOfListServers = (request: Readonly = {}) => this.client.fetch( { @@ -348,22 +346,34 @@ export class API extends ParentAPI { ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['private_ip', request.privateIp], ['private_network', request.privateNetwork], - ['private_networks', request.privateNetworks - && request.privateNetworks.length > 0 ? request.privateNetworks.join(',') : undefined], + [ + 'private_networks', + request.privateNetworks && request.privateNetworks.length > 0 + ? request.privateNetworks.join(',') + : undefined, + ], ['private_nic_mac_address', request.privateNicMacAddress], ['project', request.project], - ['servers', request.servers - && request.servers.length > 0 ? request.servers.join(',') : undefined], + [ + 'servers', + request.servers && request.servers.length > 0 + ? request.servers.join(',') + : undefined, + ], ['state', request.state], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ['with_ip', request.withIp], ['without_ip', request.withoutIp], ), }, unmarshalListServersResponse, ) - + /** * List all Instances. List all Instances in a specified Availability Zone, e.g. `fr-par-1`. * @@ -373,7 +383,6 @@ export class API extends ParentAPI { listServers = (request: Readonly = {}) => enrichForPagination('servers', this.pageOfListServers, request) - protected _createServer = (request: Readonly) => this.client.fetch( { @@ -387,21 +396,17 @@ export class API extends ParentAPI { unmarshalCreateServerResponse, ) - /** * Delete an Instance. Delete the Instance with the specified ID. * * @param request - The request {@link DeleteServerRequest} */ deleteServer = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}`, + }) - /** * Get an Instance. Get the details of a specified Instance. * @@ -417,7 +422,6 @@ export class API extends ParentAPI { unmarshalGetServerResponse, ) - protected _setServer = (request: Readonly) => this.client.fetch( { @@ -431,7 +435,6 @@ export class API extends ParentAPI { unmarshalSetServerResponse, ) - protected _updateServer = (request: Readonly) => this.client.fetch( { @@ -445,7 +448,6 @@ export class API extends ParentAPI { unmarshalUpdateServerResponse, ) - /** * List Instance actions. List all actions (e.g. power on, power off, reboot) that can currently be performed on an Instance. * @@ -461,7 +463,6 @@ export class API extends ParentAPI { unmarshalListServerActionsResponse, ) - /** * Perform action. Perform an action on an Instance. Available actions are: @@ -496,7 +497,6 @@ The `backup` action can be done with: unmarshalServerActionResponse, ) - /** * List user data. List all user data keys registered on a specified Instance. * @@ -512,21 +512,17 @@ The `backup` action can be done with: unmarshalListServerUserDataResponse, ) - /** * Delete user data. Delete the specified key from an Instance's user data. * * @param request - The request {@link DeleteServerUserDataRequest} */ deleteServerUserData = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/user_data/${validatePathParam('key', request.key)}`, + }) - /** * Get Instance compatible types. Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on: * the CPU architecture @@ -538,7 +534,9 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @param request - The request {@link GetServerCompatibleTypesRequest} * @returns A Promise of ServerCompatibleTypes */ - getServerCompatibleTypes = (request: Readonly) => + getServerCompatibleTypes = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -547,7 +545,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalServerCompatibleTypes, ) - /** * Attach a volume to an Instance. * @@ -567,7 +564,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalAttachServerVolumeResponse, ) - /** * Detach a volume from an Instance. * @@ -587,7 +583,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalDetachServerVolumeResponse, ) - /** * Attach a filesystem volume to an Instance. * @@ -607,7 +602,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalAttachServerFileSystemResponse, ) - /** * Detach a filesystem volume from an Instance. * @@ -627,7 +621,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalDetachServerFileSystemResponse, ) - protected pageOfListImages = (request: Readonly = {}) => this.client.fetch( { @@ -646,7 +639,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListImagesResponse, ) - + /** * List Instance images. List all existing Instance images. * @@ -656,7 +649,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl listImages = (request: Readonly = {}) => enrichForPagination('images', this.pageOfListImages, request) - /** * Get an Instance image. Get details of an image with the specified ID. * @@ -672,7 +664,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetImageResponse, ) - /** * Create an Instance image. Create an Instance image from the specified snapshot ID. * @@ -692,7 +683,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateImageResponse, ) - protected _setImage = (request: Readonly) => this.client.fetch( { @@ -706,7 +696,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetImageResponse, ) - /** * Update image. Update the properties of an image. * @@ -726,22 +715,20 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateImageResponse, ) - /** * Delete an Instance image. Delete the image with the specified ID. * * @param request - The request {@link DeleteImageRequest} */ deleteImage = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/images/${validatePathParam('imageId', request.imageId)}`, + }) - - protected pageOfListSnapshots = (request: Readonly = {}) => + protected pageOfListSnapshots = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -758,7 +745,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListSnapshotsResponse, ) - + /** * List snapshots. List all snapshots of an Organization in a specified Availability Zone. * @@ -768,7 +755,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Create a snapshot from a specified volume or from a QCOW2 file. Create a snapshot from a specified volume or from a QCOW2 file in a specified Availability Zone. * @@ -788,7 +774,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSnapshotResponse, ) - /** * Get a snapshot. Get details of a snapshot with the specified ID. * @@ -804,7 +789,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSnapshotResponse, ) - protected _setSnapshot = (request: Readonly) => this.client.fetch( { @@ -818,7 +802,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSnapshotResponse, ) - /** * Update a snapshot. Update the properties of a snapshot. * @@ -838,21 +821,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSnapshotResponse, ) - /** * Delete a snapshot. Delete the snapshot with the specified ID. * * @param request - The request {@link DeleteSnapshotRequest} */ deleteSnapshot = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/snapshots/${validatePathParam('snapshotId', request.snapshotId)}`, + }) - /** * Export a snapshot. Export a snapshot to a specified Object Storage bucket in the same region. * @@ -872,7 +851,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalExportSnapshotResponse, ) - protected pageOfListVolumes = (request: Readonly = {}) => this.client.fetch( { @@ -884,14 +862,18 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ['volume_type', request.volumeType], ), }, unmarshalListVolumesResponse, ) - + /** * List volumes. List volumes in the specified Availability Zone. You can filter the output by volume type. * @@ -901,7 +883,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl listVolumes = (request: Readonly = {}) => enrichForPagination('volumes', this.pageOfListVolumes, request) - /** * Create a volume. Create a volume of a specified type in an Availability Zone. * @@ -921,7 +902,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateVolumeResponse, ) - /** * Get a volume. Get details of a volume with the specified ID. * @@ -937,7 +917,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetVolumeResponse, ) - /** * Update a volume. Replace the name and/or size properties of a volume specified by its ID, with the specified value(s). * @@ -957,22 +936,20 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateVolumeResponse, ) - /** * Delete a volume. Delete the volume with the specified ID. * * @param request - The request {@link DeleteVolumeRequest} */ deleteVolume = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/volumes/${validatePathParam('volumeId', request.volumeId)}`, + }) - - protected pageOfListSecurityGroups = (request: Readonly = {}) => + protected pageOfListSecurityGroups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -984,13 +961,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], ['project_default', request.projectDefault], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ), }, unmarshalListSecurityGroupsResponse, ) - + /** * List security groups. List all existing security groups. * @@ -998,9 +979,12 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @returns A Promise of ListSecurityGroupsResponse */ listSecurityGroups = (request: Readonly = {}) => - enrichForPagination('securityGroups', this.pageOfListSecurityGroups, request) + enrichForPagination( + 'securityGroups', + this.pageOfListSecurityGroups, + request, + ) - /** * Create a security group. Create a security group with a specified name and description. * @@ -1020,7 +1004,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSecurityGroupResponse, ) - /** * Get a security group. Get the details of a security group with the specified ID. * @@ -1036,21 +1019,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSecurityGroupResponse, ) - /** * Delete a security group. Delete a security group with the specified ID. * * @param request - The request {@link DeleteSecurityGroupRequest} */ deleteSecurityGroup = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}`, + }) - protected _setSecurityGroup = (request: Readonly) => this.client.fetch( { @@ -1064,7 +1043,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupResponse, ) - /** * Update a security group. Update the properties of security group. * @@ -1084,14 +1062,15 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSecurityGroupResponse, ) - /** * Get default rules. Lists the default rules applied to all the security groups. * * @param request - The request {@link ListDefaultSecurityGroupRulesRequest} * @returns A Promise of ListSecurityGroupRulesResponse */ - listDefaultSecurityGroupRules = (request: Readonly = {}) => + listDefaultSecurityGroupRules = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1100,8 +1079,9 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalListSecurityGroupRulesResponse, ) - - protected pageOfListSecurityGroupRules = (request: Readonly) => + protected pageOfListSecurityGroupRules = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1113,7 +1093,7 @@ If the specified Instance offer is flagged as end of service, the best compatibl }, unmarshalListSecurityGroupRulesResponse, ) - + /** * List rules. List the rules of the a specified security group ID. * @@ -1123,14 +1103,15 @@ If the specified Instance offer is flagged as end of service, the best compatibl listSecurityGroupRules = (request: Readonly) => enrichForPagination('rules', this.pageOfListSecurityGroupRules, request) - /** * Create rule. Create a rule in the specified security group ID. * * @param request - The request {@link CreateSecurityGroupRuleRequest} * @returns A Promise of CreateSecurityGroupRuleResponse */ - createSecurityGroupRule = (request: Readonly) => + createSecurityGroupRule = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -1143,7 +1124,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateSecurityGroupRuleResponse, ) - /** * Update all the rules of a security group. Replaces the existing rules of the security group with the rules provided. This endpoint supports the update of existing rules, creation of new rules and deletion of existing rules when they are not passed in the request. * @@ -1163,21 +1143,19 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupRulesResponse, ) - /** * Delete rule. Delete a security group rule with the specified ID. * * @param request - The request {@link DeleteSecurityGroupRuleRequest} */ - deleteSecurityGroupRule = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`, - }, - ) + deleteSecurityGroupRule = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/security_groups/${validatePathParam('securityGroupId', request.securityGroupId)}/rules/${validatePathParam('securityGroupRuleId', request.securityGroupRuleId)}`, + }) - /** * Get rule. Get details of a security group rule with the specified ID. * @@ -1193,8 +1171,9 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetSecurityGroupRuleResponse, ) - - protected _setSecurityGroupRule = (request: Readonly) => + protected _setSecurityGroupRule = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -1207,14 +1186,15 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetSecurityGroupRuleResponse, ) - /** * Update security group rule. Update the properties of a rule from a specified security group. * * @param request - The request {@link UpdateSecurityGroupRuleRequest} * @returns A Promise of UpdateSecurityGroupRuleResponse */ - updateSecurityGroupRule = (request: Readonly) => + updateSecurityGroupRule = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -1227,8 +1207,9 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateSecurityGroupRuleResponse, ) - - protected pageOfListPlacementGroups = (request: Readonly = {}) => + protected pageOfListPlacementGroups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1239,13 +1220,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ), }, unmarshalListPlacementGroupsResponse, ) - + /** * List placement groups. List all placement groups in a specified Availability Zone. * @@ -1253,16 +1238,21 @@ If the specified Instance offer is flagged as end of service, the best compatibl * @returns A Promise of ListPlacementGroupsResponse */ listPlacementGroups = (request: Readonly = {}) => - enrichForPagination('placementGroups', this.pageOfListPlacementGroups, request) + enrichForPagination( + 'placementGroups', + this.pageOfListPlacementGroups, + request, + ) - /** * Create a placement group. Create a new placement group in a specified Availability Zone. * * @param request - The request {@link CreatePlacementGroupRequest} * @returns A Promise of CreatePlacementGroupResponse */ - createPlacementGroup = (request: Readonly = {}) => + createPlacementGroup = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( @@ -1275,7 +1265,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreatePlacementGroupResponse, ) - /** * Get a placement group. Get the specified placement group. * @@ -1291,7 +1280,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPlacementGroupResponse, ) - /** * Set placement group. Set all parameters of the specified placement group. * @@ -1311,7 +1299,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetPlacementGroupResponse, ) - /** * Update a placement group. Update one or more parameter of the specified placement group. * @@ -1331,28 +1318,26 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdatePlacementGroupResponse, ) - /** * Delete the specified placement group. * * @param request - The request {@link DeletePlacementGroupRequest} */ deletePlacementGroup = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/placement_groups/${validatePathParam('placementGroupId', request.placementGroupId)}`, + }) - /** * Get placement group servers. Get all Instances belonging to the specified placement group. * * @param request - The request {@link GetPlacementGroupServersRequest} * @returns A Promise of GetPlacementGroupServersResponse */ - getPlacementGroupServers = (request: Readonly) => + getPlacementGroupServers = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1361,14 +1346,15 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPlacementGroupServersResponse, ) - /** * Set placement group servers. Set all Instances belonging to the specified placement group. * * @param request - The request {@link SetPlacementGroupServersRequest} * @returns A Promise of SetPlacementGroupServersResponse */ - setPlacementGroupServers = (request: Readonly) => + setPlacementGroupServers = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( @@ -1381,18 +1367,22 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalSetPlacementGroupServersResponse, ) - /** * Update placement group servers. Update all Instances belonging to the specified placement group. * * @param request - The request {@link UpdatePlacementGroupServersRequest} * @returns A Promise of UpdatePlacementGroupServersResponse */ - updatePlacementGroupServers = (request: Readonly) => + updatePlacementGroupServers = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalUpdatePlacementGroupServersRequest(request, this.client.settings), + marshalUpdatePlacementGroupServersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -1401,7 +1391,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdatePlacementGroupServersResponse, ) - protected pageOfListIps = (request: Readonly = {}) => this.client.fetch( { @@ -1413,14 +1402,18 @@ If the specified Instance offer is flagged as end of service, the best compatibl ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], ['project', request.project], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ['type', request.type], ), }, unmarshalListIpsResponse, ) - + /** * List all flexible IPs. List all flexible IPs in a specified zone. * @@ -1430,7 +1423,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl listIps = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIps, request) - /** * Reserve a flexible IP. Reserve a flexible IP and attach it to the specified Instance. * @@ -1450,7 +1442,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreateIpResponse, ) - /** * Get a flexible IP. Get details of an IP with the specified ID or address. * @@ -1466,7 +1457,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetIpResponse, ) - /** * Update a flexible IP. Update a flexible IP in the specified zone with the specified ID. * @@ -1486,22 +1476,20 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalUpdateIpResponse, ) - /** * Delete a flexible IP. Delete the IP with the specified ID. * * @param request - The request {@link DeleteIpRequest} */ deleteIp = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ip', request.ip)}`, + }) - - protected pageOfListPrivateNICs = (request: Readonly) => + protected pageOfListPrivateNICs = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1509,13 +1497,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl urlParams: urlParams( ['page', request.page], ['per_page', request.perPage ?? this.client.settings.defaultPageSize], - ['tags', request.tags - && request.tags.length > 0 ? request.tags.join(',') : undefined], + [ + 'tags', + request.tags && request.tags.length > 0 + ? request.tags.join(',') + : undefined, + ], ), }, unmarshalListPrivateNICsResponse, ) - + /** * List all private NICs. List all private NICs of a specified Instance. * @@ -1525,7 +1517,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl listPrivateNICs = (request: Readonly) => enrichForPagination('privateNics', this.pageOfListPrivateNICs, request) - /** * Create a private NIC connecting an Instance to a Private Network. * @@ -1545,7 +1536,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalCreatePrivateNICResponse, ) - /** * Get a private NIC. Get private NIC properties. * @@ -1561,7 +1551,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetPrivateNICResponse, ) - /** * Update a private NIC. Update one or more parameter(s) of a specified private NIC. * @@ -1581,21 +1570,17 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalPrivateNIC, ) - /** * Delete a private NIC. * * @param request - The request {@link DeletePrivateNICRequest} */ deletePrivateNIC = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/private_nics/${validatePathParam('privateNicId', request.privateNicId)}`, + }) - getDashboard = (request: Readonly = {}) => this.client.fetch( { @@ -1609,7 +1594,6 @@ If the specified Instance offer is flagged as end of service, the best compatibl unmarshalGetDashboardResponse, ) - /** * Get a volume or snapshot's migration plan. Given a volume or snapshot, returns the migration plan but does not perform the actual migration. To perform the migration, you have to call the [Migrate a volume and/or snapshots to SBS](#path-volumes-migrate-a-volume-andor-snapshots-to-sbs-scaleway-block-storage) endpoint afterward. The endpoint returns the resources that should be migrated together: @@ -1633,53 +1617,46 @@ The endpoint also returns the validation_key, which must be provided to the [Mig unmarshalMigrationPlan, ) - /** * Migrate a volume and/or snapshots to SBS (Scaleway Block Storage). To be used, the call to this endpoint must be preceded by a call to the [Get a volume or snapshot's migration plan](#path-volumes-get-a-volume-or-snapshots-migration-plan) endpoint. To migrate all resources mentioned in the migration plan, the validation_key returned in the plan must be provided. * * @param request - The request {@link ApplyBlockMigrationRequest} */ applyBlockMigration = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalApplyBlockMigrationRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalApplyBlockMigrationRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/apply`, + }) - - checkBlockMigrationOrganizationQuotas = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalCheckBlockMigrationOrganizationQuotasRequest(request, this.client.settings), + checkBlockMigrationOrganizationQuotas = ( + request: Readonly = {}, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalCheckBlockMigrationOrganizationQuotasRequest( + request, + this.client.settings, ), - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`, - }, - ) + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/block-migration/check-organization-quotas`, + }) - /** * Releases the reserved IP without deleting the reservation.. **The IP remains available in IPAM**, which means that it is still reserved by the Organization, and can be reattached to another resource (Instance or other product). * * @param request - The request {@link ReleaseIpToIpamRequest} */ releaseIpToIpam = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}/release-to-ipam`, - }, - ) - - + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/instance/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}/release-to-ipam`, + }) } - diff --git a/packages_generated/instance/src/v1/content.gen.ts b/packages_generated/instance/src/v1/content.gen.ts index 839c2e6cc..e36ea263c 100644 --- a/packages_generated/instance/src/v1/content.gen.ts +++ b/packages_generated/instance/src/v1/content.gen.ts @@ -14,21 +14,14 @@ import type { VolumeState, } from './types.gen.js' - /** Lists transient statutes of the enum {@link ImageState}. */ -export const IMAGE_TRANSIENT_STATUSES: ImageState[] = [ - 'creating', -] +export const IMAGE_TRANSIENT_STATUSES: ImageState[] = ['creating'] /** Lists transient statutes of the enum {@link IpState}. */ -export const IP_TRANSIENT_STATUSES: IpState[] = [ - 'pending', -] +export const IP_TRANSIENT_STATUSES: IpState[] = ['pending'] /** Lists transient statutes of the enum {@link PrivateNICState}. */ -export const PRIVATE_NIC_TRANSIENT_STATUSES: PrivateNICState[] = [ - 'syncing', -] +export const PRIVATE_NIC_TRANSIENT_STATUSES: PrivateNICState[] = ['syncing'] /** Lists transient statutes of the enum {@link SecurityGroupState}. */ export const SECURITY_GROUP_TRANSIENT_STATUSES: SecurityGroupState[] = [ @@ -42,15 +35,10 @@ export const SERVER_FILESYSTEM_TRANSIENT_STATUSES: ServerFilesystemState[] = [ ] /** Lists transient statutes of the enum {@link ServerIpState}. */ -export const SERVER_IP_TRANSIENT_STATUSES: ServerIpState[] = [ - 'pending', -] +export const SERVER_IP_TRANSIENT_STATUSES: ServerIpState[] = ['pending'] /** Lists transient statutes of the enum {@link ServerState}. */ -export const SERVER_TRANSIENT_STATUSES: ServerState[] = [ - 'starting', - 'stopping', -] +export const SERVER_TRANSIENT_STATUSES: ServerState[] = ['starting', 'stopping'] /** Lists transient statutes of the enum {@link SnapshotState}. */ export const SNAPSHOT_TRANSIENT_STATUSES: SnapshotState[] = [ @@ -85,4 +73,3 @@ export const VOLUME_TRANSIENT_STATUSES: VolumeState[] = [ 'resizing', 'hotsyncing', ] - diff --git a/packages_generated/instance/src/v1/index.gen.ts b/packages_generated/instance/src/v1/index.gen.ts index 9d7fd3456..e61342883 100644 --- a/packages_generated/instance/src/v1/index.gen.ts +++ b/packages_generated/instance/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/instance/src/v1/marshalling.gen.ts b/packages_generated/instance/src/v1/marshalling.gen.ts index fb9ded79e..e98ed0e99 100644 --- a/packages_generated/instance/src/v1/marshalling.gen.ts +++ b/packages_generated/instance/src/v1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMapOfObject, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMapOfObject, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { PrivateNIC, @@ -246,7 +252,9 @@ const unmarshalImage = (data: unknown): Image => { return { arch: data.arch, creationDate: unmarshalDate(data.creation_date), - defaultBootscript: data.default_bootscript ? unmarshalBootscript(data.default_bootscript) : undefined, + defaultBootscript: data.default_bootscript + ? unmarshalBootscript(data.default_bootscript) + : undefined, extraVolumes: unmarshalMapOfObject(data.extra_volumes, unmarshalVolume), fromServer: data.from_server, id: data.id, @@ -255,7 +263,9 @@ const unmarshalImage = (data: unknown): Image => { organization: data.organization, project: data.project, public: data.public, - rootVolume: data.root_volume ? unmarshalVolumeSummary(data.root_volume) : undefined, + rootVolume: data.root_volume + ? unmarshalVolumeSummary(data.root_volume) + : undefined, state: data.state, tags: data.tags, zone: data.zone, @@ -414,18 +424,28 @@ const unmarshalServer = (data: unknown): Server => { dynamicIpRequired: data.dynamic_ip_required, enableIpv6: data.enable_ipv6, endOfService: data.end_of_service, - filesystems: unmarshalArrayOfObject(data.filesystems, unmarshalServerFilesystem), + filesystems: unmarshalArrayOfObject( + data.filesystems, + unmarshalServerFilesystem, + ), hostname: data.hostname, id: data.id, image: data.image ? unmarshalImage(data.image) : undefined, ipv6: data.ipv6 ? unmarshalServerIpv6(data.ipv6) : undefined, - location: data.location ? unmarshalServerLocation(data.location) : undefined, + location: data.location + ? unmarshalServerLocation(data.location) + : undefined, macAddress: data.mac_address, - maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalServerMaintenance), + maintenances: unmarshalArrayOfObject( + data.maintenances, + unmarshalServerMaintenance, + ), modificationDate: unmarshalDate(data.modification_date), name: data.name, organization: data.organization, - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, + placementGroup: data.placement_group + ? unmarshalPlacementGroup(data.placement_group) + : undefined, privateIp: data.private_ip, privateNics: unmarshalArrayOfObject(data.private_nics, unmarshalPrivateNIC), project: data.project, @@ -433,7 +453,9 @@ const unmarshalServer = (data: unknown): Server => { publicIp: data.public_ip ? unmarshalServerIp(data.public_ip) : undefined, publicIps: unmarshalArrayOfObject(data.public_ips, unmarshalServerIp), routedIpEnabled: data.routed_ip_enabled, - securityGroup: data.security_group ? unmarshalSecurityGroupSummary(data.security_group) : undefined, + securityGroup: data.security_group + ? unmarshalSecurityGroupSummary(data.security_group) + : undefined, state: data.state, stateDetail: data.state_detail, tags: data.tags, @@ -442,7 +464,9 @@ const unmarshalServer = (data: unknown): Server => { } as Server } -export const unmarshalAttachServerFileSystemResponse = (data: unknown): AttachServerFileSystemResponse => { +export const unmarshalAttachServerFileSystemResponse = ( + data: unknown, +): AttachServerFileSystemResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AttachServerFileSystemResponse' failed as data isn't a dictionary.`, @@ -454,7 +478,9 @@ export const unmarshalAttachServerFileSystemResponse = (data: unknown): AttachSe } as AttachServerFileSystemResponse } -export const unmarshalAttachServerVolumeResponse = (data: unknown): AttachServerVolumeResponse => { +export const unmarshalAttachServerVolumeResponse = ( + data: unknown, +): AttachServerVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AttachServerVolumeResponse' failed as data isn't a dictionary.`, @@ -466,7 +492,9 @@ export const unmarshalAttachServerVolumeResponse = (data: unknown): AttachServer } as AttachServerVolumeResponse } -export const unmarshalCreateImageResponse = (data: unknown): CreateImageResponse => { +export const unmarshalCreateImageResponse = ( + data: unknown, +): CreateImageResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateImageResponse' failed as data isn't a dictionary.`, @@ -513,7 +541,9 @@ export const unmarshalCreateIpResponse = (data: unknown): CreateIpResponse => { } as CreateIpResponse } -export const unmarshalCreatePlacementGroupResponse = (data: unknown): CreatePlacementGroupResponse => { +export const unmarshalCreatePlacementGroupResponse = ( + data: unknown, +): CreatePlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreatePlacementGroupResponse' failed as data isn't a dictionary.`, @@ -521,11 +551,15 @@ export const unmarshalCreatePlacementGroupResponse = (data: unknown): CreatePlac } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, + placementGroup: data.placement_group + ? unmarshalPlacementGroup(data.placement_group) + : undefined, } as CreatePlacementGroupResponse } -export const unmarshalCreatePrivateNICResponse = (data: unknown): CreatePrivateNICResponse => { +export const unmarshalCreatePrivateNICResponse = ( + data: unknown, +): CreatePrivateNICResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreatePrivateNICResponse' failed as data isn't a dictionary.`, @@ -533,7 +567,9 @@ export const unmarshalCreatePrivateNICResponse = (data: unknown): CreatePrivateN } return { - privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined, + privateNic: data.private_nic + ? unmarshalPrivateNIC(data.private_nic) + : undefined, } as CreatePrivateNICResponse } @@ -565,7 +601,9 @@ const unmarshalSecurityGroup = (data: unknown): SecurityGroup => { } as SecurityGroup } -export const unmarshalCreateSecurityGroupResponse = (data: unknown): CreateSecurityGroupResponse => { +export const unmarshalCreateSecurityGroupResponse = ( + data: unknown, +): CreateSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -573,7 +611,9 @@ export const unmarshalCreateSecurityGroupResponse = (data: unknown): CreateSecur } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, + securityGroup: data.security_group + ? unmarshalSecurityGroup(data.security_group) + : undefined, } as CreateSecurityGroupResponse } @@ -598,7 +638,9 @@ const unmarshalSecurityGroupRule = (data: unknown): SecurityGroupRule => { } as SecurityGroupRule } -export const unmarshalCreateSecurityGroupRuleResponse = (data: unknown): CreateSecurityGroupRuleResponse => { +export const unmarshalCreateSecurityGroupRuleResponse = ( + data: unknown, +): CreateSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -610,7 +652,9 @@ export const unmarshalCreateSecurityGroupRuleResponse = (data: unknown): CreateS } as CreateSecurityGroupRuleResponse } -export const unmarshalCreateServerResponse = (data: unknown): CreateServerResponse => { +export const unmarshalCreateServerResponse = ( + data: unknown, +): CreateServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateServerResponse' failed as data isn't a dictionary.`, @@ -643,7 +687,9 @@ const unmarshalSnapshot = (data: unknown): Snapshot => { } return { - baseVolume: data.base_volume ? unmarshalSnapshotBaseVolume(data.base_volume) : undefined, + baseVolume: data.base_volume + ? unmarshalSnapshotBaseVolume(data.base_volume) + : undefined, creationDate: unmarshalDate(data.creation_date), errorReason: data.error_reason, id: data.id, @@ -679,7 +725,9 @@ const unmarshalTask = (data: unknown): Task => { } as Task } -export const unmarshalCreateSnapshotResponse = (data: unknown): CreateSnapshotResponse => { +export const unmarshalCreateSnapshotResponse = ( + data: unknown, +): CreateSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateSnapshotResponse' failed as data isn't a dictionary.`, @@ -692,7 +740,9 @@ export const unmarshalCreateSnapshotResponse = (data: unknown): CreateSnapshotRe } as CreateSnapshotResponse } -export const unmarshalCreateVolumeResponse = (data: unknown): CreateVolumeResponse => { +export const unmarshalCreateVolumeResponse = ( + data: unknown, +): CreateVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateVolumeResponse' failed as data isn't a dictionary.`, @@ -704,7 +754,9 @@ export const unmarshalCreateVolumeResponse = (data: unknown): CreateVolumeRespon } as CreateVolumeResponse } -export const unmarshalDetachServerFileSystemResponse = (data: unknown): DetachServerFileSystemResponse => { +export const unmarshalDetachServerFileSystemResponse = ( + data: unknown, +): DetachServerFileSystemResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DetachServerFileSystemResponse' failed as data isn't a dictionary.`, @@ -716,7 +768,9 @@ export const unmarshalDetachServerFileSystemResponse = (data: unknown): DetachSe } as DetachServerFileSystemResponse } -export const unmarshalDetachServerVolumeResponse = (data: unknown): DetachServerVolumeResponse => { +export const unmarshalDetachServerVolumeResponse = ( + data: unknown, +): DetachServerVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DetachServerVolumeResponse' failed as data isn't a dictionary.`, @@ -728,7 +782,9 @@ export const unmarshalDetachServerVolumeResponse = (data: unknown): DetachServer } as DetachServerVolumeResponse } -export const unmarshalExportSnapshotResponse = (data: unknown): ExportSnapshotResponse => { +export const unmarshalExportSnapshotResponse = ( + data: unknown, +): ExportSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ExportSnapshotResponse' failed as data isn't a dictionary.`, @@ -766,7 +822,9 @@ const unmarshalDashboard = (data: unknown): Dashboard => { } as Dashboard } -export const unmarshalGetDashboardResponse = (data: unknown): GetDashboardResponse => { +export const unmarshalGetDashboardResponse = ( + data: unknown, +): GetDashboardResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDashboardResponse' failed as data isn't a dictionary.`, @@ -802,7 +860,9 @@ export const unmarshalGetIpResponse = (data: unknown): GetIpResponse => { } as GetIpResponse } -export const unmarshalGetPlacementGroupResponse = (data: unknown): GetPlacementGroupResponse => { +export const unmarshalGetPlacementGroupResponse = ( + data: unknown, +): GetPlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPlacementGroupResponse' failed as data isn't a dictionary.`, @@ -810,7 +870,9 @@ export const unmarshalGetPlacementGroupResponse = (data: unknown): GetPlacementG } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, + placementGroup: data.placement_group + ? unmarshalPlacementGroup(data.placement_group) + : undefined, } as GetPlacementGroupResponse } @@ -828,7 +890,9 @@ const unmarshalPlacementGroupServer = (data: unknown): PlacementGroupServer => { } as PlacementGroupServer } -export const unmarshalGetPlacementGroupServersResponse = (data: unknown): GetPlacementGroupServersResponse => { +export const unmarshalGetPlacementGroupServersResponse = ( + data: unknown, +): GetPlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -836,11 +900,16 @@ export const unmarshalGetPlacementGroupServersResponse = (data: unknown): GetPla } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), + servers: unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer, + ), } as GetPlacementGroupServersResponse } -export const unmarshalGetPrivateNICResponse = (data: unknown): GetPrivateNICResponse => { +export const unmarshalGetPrivateNICResponse = ( + data: unknown, +): GetPrivateNICResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetPrivateNICResponse' failed as data isn't a dictionary.`, @@ -848,11 +917,15 @@ export const unmarshalGetPrivateNICResponse = (data: unknown): GetPrivateNICResp } return { - privateNic: data.private_nic ? unmarshalPrivateNIC(data.private_nic) : undefined, + privateNic: data.private_nic + ? unmarshalPrivateNIC(data.private_nic) + : undefined, } as GetPrivateNICResponse } -export const unmarshalGetSecurityGroupResponse = (data: unknown): GetSecurityGroupResponse => { +export const unmarshalGetSecurityGroupResponse = ( + data: unknown, +): GetSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -860,11 +933,15 @@ export const unmarshalGetSecurityGroupResponse = (data: unknown): GetSecurityGro } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, + securityGroup: data.security_group + ? unmarshalSecurityGroup(data.security_group) + : undefined, } as GetSecurityGroupResponse } -export const unmarshalGetSecurityGroupRuleResponse = (data: unknown): GetSecurityGroupRuleResponse => { +export const unmarshalGetSecurityGroupRuleResponse = ( + data: unknown, +): GetSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -876,7 +953,9 @@ export const unmarshalGetSecurityGroupRuleResponse = (data: unknown): GetSecurit } as GetSecurityGroupRuleResponse } -export const unmarshalGetServerResponse = (data: unknown): GetServerResponse => { +export const unmarshalGetServerResponse = ( + data: unknown, +): GetServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerResponse' failed as data isn't a dictionary.`, @@ -888,7 +967,9 @@ export const unmarshalGetServerResponse = (data: unknown): GetServerResponse => } as GetServerResponse } -const unmarshalGetServerTypesAvailabilityResponseAvailability = (data: unknown): GetServerTypesAvailabilityResponseAvailability => { +const unmarshalGetServerTypesAvailabilityResponseAvailability = ( + data: unknown, +): GetServerTypesAvailabilityResponseAvailability => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerTypesAvailabilityResponseAvailability' failed as data isn't a dictionary.`, @@ -900,7 +981,9 @@ const unmarshalGetServerTypesAvailabilityResponseAvailability = (data: unknown): } as GetServerTypesAvailabilityResponseAvailability } -export const unmarshalGetServerTypesAvailabilityResponse = (data: unknown): GetServerTypesAvailabilityResponse => { +export const unmarshalGetServerTypesAvailabilityResponse = ( + data: unknown, +): GetServerTypesAvailabilityResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetServerTypesAvailabilityResponse' failed as data isn't a dictionary.`, @@ -908,12 +991,17 @@ export const unmarshalGetServerTypesAvailabilityResponse = (data: unknown): GetS } return { - servers: unmarshalMapOfObject(data.servers, unmarshalGetServerTypesAvailabilityResponseAvailability), + servers: unmarshalMapOfObject( + data.servers, + unmarshalGetServerTypesAvailabilityResponseAvailability, + ), totalCount: data.total_count, } as GetServerTypesAvailabilityResponse } -export const unmarshalGetSnapshotResponse = (data: unknown): GetSnapshotResponse => { +export const unmarshalGetSnapshotResponse = ( + data: unknown, +): GetSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetSnapshotResponse' failed as data isn't a dictionary.`, @@ -925,7 +1013,9 @@ export const unmarshalGetSnapshotResponse = (data: unknown): GetSnapshotResponse } as GetSnapshotResponse } -export const unmarshalGetVolumeResponse = (data: unknown): GetVolumeResponse => { +export const unmarshalGetVolumeResponse = ( + data: unknown, +): GetVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetVolumeResponse' failed as data isn't a dictionary.`, @@ -937,7 +1027,9 @@ export const unmarshalGetVolumeResponse = (data: unknown): GetVolumeResponse => } as GetVolumeResponse } -export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse => { +export const unmarshalListImagesResponse = ( + data: unknown, +): ListImagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`, @@ -963,7 +1055,9 @@ export const unmarshalListIpsResponse = (data: unknown): ListIpsResponse => { } as ListIpsResponse } -export const unmarshalListPlacementGroupsResponse = (data: unknown): ListPlacementGroupsResponse => { +export const unmarshalListPlacementGroupsResponse = ( + data: unknown, +): ListPlacementGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPlacementGroupsResponse' failed as data isn't a dictionary.`, @@ -971,12 +1065,17 @@ export const unmarshalListPlacementGroupsResponse = (data: unknown): ListPlaceme } return { - placementGroups: unmarshalArrayOfObject(data.placement_groups, unmarshalPlacementGroup), + placementGroups: unmarshalArrayOfObject( + data.placement_groups, + unmarshalPlacementGroup, + ), totalCount: data.total_count, } as ListPlacementGroupsResponse } -export const unmarshalListPrivateNICsResponse = (data: unknown): ListPrivateNICsResponse => { +export const unmarshalListPrivateNICsResponse = ( + data: unknown, +): ListPrivateNICsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPrivateNICsResponse' failed as data isn't a dictionary.`, @@ -989,7 +1088,9 @@ export const unmarshalListPrivateNICsResponse = (data: unknown): ListPrivateNICs } as ListPrivateNICsResponse } -export const unmarshalListSecurityGroupRulesResponse = (data: unknown): ListSecurityGroupRulesResponse => { +export const unmarshalListSecurityGroupRulesResponse = ( + data: unknown, +): ListSecurityGroupRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecurityGroupRulesResponse' failed as data isn't a dictionary.`, @@ -1002,7 +1103,9 @@ export const unmarshalListSecurityGroupRulesResponse = (data: unknown): ListSecu } as ListSecurityGroupRulesResponse } -export const unmarshalListSecurityGroupsResponse = (data: unknown): ListSecurityGroupsResponse => { +export const unmarshalListSecurityGroupsResponse = ( + data: unknown, +): ListSecurityGroupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecurityGroupsResponse' failed as data isn't a dictionary.`, @@ -1010,12 +1113,17 @@ export const unmarshalListSecurityGroupsResponse = (data: unknown): ListSecurity } return { - securityGroups: unmarshalArrayOfObject(data.security_groups, unmarshalSecurityGroup), + securityGroups: unmarshalArrayOfObject( + data.security_groups, + unmarshalSecurityGroup, + ), totalCount: data.total_count, } as ListSecurityGroupsResponse } -export const unmarshalListServerActionsResponse = (data: unknown): ListServerActionsResponse => { +export const unmarshalListServerActionsResponse = ( + data: unknown, +): ListServerActionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerActionsResponse' failed as data isn't a dictionary.`, @@ -1027,7 +1135,9 @@ export const unmarshalListServerActionsResponse = (data: unknown): ListServerAct } as ListServerActionsResponse } -export const unmarshalListServerUserDataResponse = (data: unknown): ListServerUserDataResponse => { +export const unmarshalListServerUserDataResponse = ( + data: unknown, +): ListServerUserDataResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServerUserDataResponse' failed as data isn't a dictionary.`, @@ -1039,7 +1149,9 @@ export const unmarshalListServerUserDataResponse = (data: unknown): ListServerUs } as ListServerUserDataResponse } -export const unmarshalListServersResponse = (data: unknown): ListServersResponse => { +export const unmarshalListServersResponse = ( + data: unknown, +): ListServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary.`, @@ -1052,7 +1164,9 @@ export const unmarshalListServersResponse = (data: unknown): ListServersResponse } as ListServersResponse } -const unmarshalServerTypeNetworkInterface = (data: unknown): ServerTypeNetworkInterface => { +const unmarshalServerTypeNetworkInterface = ( + data: unknown, +): ServerTypeNetworkInterface => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeNetworkInterface' failed as data isn't a dictionary.`, @@ -1065,7 +1179,9 @@ const unmarshalServerTypeNetworkInterface = (data: unknown): ServerTypeNetworkIn } as ServerTypeNetworkInterface } -const unmarshalServerTypeVolumeConstraintSizes = (data: unknown): ServerTypeVolumeConstraintSizes => { +const unmarshalServerTypeVolumeConstraintSizes = ( + data: unknown, +): ServerTypeVolumeConstraintSizes => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeVolumeConstraintSizes' failed as data isn't a dictionary.`, @@ -1078,7 +1194,9 @@ const unmarshalServerTypeVolumeConstraintSizes = (data: unknown): ServerTypeVolu } as ServerTypeVolumeConstraintSizes } -const unmarshalServerTypeCapabilities = (data: unknown): ServerTypeCapabilities => { +const unmarshalServerTypeCapabilities = ( + data: unknown, +): ServerTypeCapabilities => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeCapabilities' failed as data isn't a dictionary.`, @@ -1114,14 +1232,19 @@ const unmarshalServerTypeNetwork = (data: unknown): ServerTypeNetwork => { } return { - interfaces: unmarshalArrayOfObject(data.interfaces, unmarshalServerTypeNetworkInterface), + interfaces: unmarshalArrayOfObject( + data.interfaces, + unmarshalServerTypeNetworkInterface, + ), ipv6Support: data.ipv6_support, sumInternalBandwidth: data.sum_internal_bandwidth, sumInternetBandwidth: data.sum_internet_bandwidth, } as ServerTypeNetwork } -const unmarshalServerTypeVolumeConstraintsByType = (data: unknown): ServerTypeVolumeConstraintsByType => { +const unmarshalServerTypeVolumeConstraintsByType = ( + data: unknown, +): ServerTypeVolumeConstraintsByType => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerTypeVolumeConstraintsByType' failed as data isn't a dictionary.`, @@ -1129,7 +1252,9 @@ const unmarshalServerTypeVolumeConstraintsByType = (data: unknown): ServerTypeVo } return { - lSsd: data.l_ssd ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) : undefined, + lSsd: data.l_ssd + ? unmarshalServerTypeVolumeConstraintSizes(data.l_ssd) + : undefined, } as ServerTypeVolumeConstraintsByType } @@ -1144,22 +1269,34 @@ const unmarshalServerType = (data: unknown): ServerType => { altNames: data.alt_names, arch: data.arch, blockBandwidth: data.block_bandwidth, - capabilities: data.capabilities ? unmarshalServerTypeCapabilities(data.capabilities) : undefined, + capabilities: data.capabilities + ? unmarshalServerTypeCapabilities(data.capabilities) + : undefined, endOfService: data.end_of_service, gpu: data.gpu, - gpuInfo: data.gpu_info ? unmarshalServerTypeGPUInfo(data.gpu_info) : undefined, + gpuInfo: data.gpu_info + ? unmarshalServerTypeGPUInfo(data.gpu_info) + : undefined, hourlyPrice: data.hourly_price, monthlyPrice: data.monthly_price, ncpus: data.ncpus, - network: data.network ? unmarshalServerTypeNetwork(data.network) : undefined, - perVolumeConstraint: data.per_volume_constraint ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) : undefined, + network: data.network + ? unmarshalServerTypeNetwork(data.network) + : undefined, + perVolumeConstraint: data.per_volume_constraint + ? unmarshalServerTypeVolumeConstraintsByType(data.per_volume_constraint) + : undefined, ram: data.ram, scratchStorageMaxSize: data.scratch_storage_max_size, - volumesConstraint: data.volumes_constraint ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) : undefined, + volumesConstraint: data.volumes_constraint + ? unmarshalServerTypeVolumeConstraintSizes(data.volumes_constraint) + : undefined, } as ServerType } -export const unmarshalListServersTypesResponse = (data: unknown): ListServersTypesResponse => { +export const unmarshalListServersTypesResponse = ( + data: unknown, +): ListServersTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListServersTypesResponse' failed as data isn't a dictionary.`, @@ -1172,7 +1309,9 @@ export const unmarshalListServersTypesResponse = (data: unknown): ListServersTyp } as ListServersTypesResponse } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -1185,7 +1324,9 @@ export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResp } as ListSnapshotsResponse } -export const unmarshalListVolumesResponse = (data: unknown): ListVolumesResponse => { +export const unmarshalListVolumesResponse = ( + data: unknown, +): ListVolumesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesResponse' failed as data isn't a dictionary.`, @@ -1198,7 +1339,9 @@ export const unmarshalListVolumesResponse = (data: unknown): ListVolumesResponse } as ListVolumesResponse } -const unmarshalVolumeTypeCapabilities = (data: unknown): VolumeTypeCapabilities => { +const unmarshalVolumeTypeCapabilities = ( + data: unknown, +): VolumeTypeCapabilities => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeTypeCapabilities' failed as data isn't a dictionary.`, @@ -1210,7 +1353,9 @@ const unmarshalVolumeTypeCapabilities = (data: unknown): VolumeTypeCapabilities } as VolumeTypeCapabilities } -const unmarshalVolumeTypeConstraints = (data: unknown): VolumeTypeConstraints => { +const unmarshalVolumeTypeConstraints = ( + data: unknown, +): VolumeTypeConstraints => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VolumeTypeConstraints' failed as data isn't a dictionary.`, @@ -1231,13 +1376,19 @@ const unmarshalVolumeType = (data: unknown): VolumeType => { } return { - capabilities: data.capabilities ? unmarshalVolumeTypeCapabilities(data.capabilities) : undefined, - constraints: data.constraints ? unmarshalVolumeTypeConstraints(data.constraints) : undefined, + capabilities: data.capabilities + ? unmarshalVolumeTypeCapabilities(data.capabilities) + : undefined, + constraints: data.constraints + ? unmarshalVolumeTypeConstraints(data.constraints) + : undefined, displayName: data.display_name, } as VolumeType } -export const unmarshalListVolumesTypesResponse = (data: unknown): ListVolumesTypesResponse => { +export const unmarshalListVolumesTypesResponse = ( + data: unknown, +): ListVolumesTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVolumesTypesResponse' failed as data isn't a dictionary.`, @@ -1264,7 +1415,9 @@ export const unmarshalMigrationPlan = (data: unknown): MigrationPlan => { } as MigrationPlan } -export const unmarshalServerActionResponse = (data: unknown): ServerActionResponse => { +export const unmarshalServerActionResponse = ( + data: unknown, +): ServerActionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerActionResponse' failed as data isn't a dictionary.`, @@ -1276,7 +1429,9 @@ export const unmarshalServerActionResponse = (data: unknown): ServerActionRespon } as ServerActionResponse } -export const unmarshalServerCompatibleTypes = (data: unknown): ServerCompatibleTypes => { +export const unmarshalServerCompatibleTypes = ( + data: unknown, +): ServerCompatibleTypes => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ServerCompatibleTypes' failed as data isn't a dictionary.`, @@ -1300,7 +1455,9 @@ export const unmarshalSetImageResponse = (data: unknown): SetImageResponse => { } as SetImageResponse } -export const unmarshalSetPlacementGroupResponse = (data: unknown): SetPlacementGroupResponse => { +export const unmarshalSetPlacementGroupResponse = ( + data: unknown, +): SetPlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPlacementGroupResponse' failed as data isn't a dictionary.`, @@ -1308,11 +1465,15 @@ export const unmarshalSetPlacementGroupResponse = (data: unknown): SetPlacementG } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, + placementGroup: data.placement_group + ? unmarshalPlacementGroup(data.placement_group) + : undefined, } as SetPlacementGroupResponse } -export const unmarshalSetPlacementGroupServersResponse = (data: unknown): SetPlacementGroupServersResponse => { +export const unmarshalSetPlacementGroupServersResponse = ( + data: unknown, +): SetPlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -1320,11 +1481,16 @@ export const unmarshalSetPlacementGroupServersResponse = (data: unknown): SetPla } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), + servers: unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer, + ), } as SetPlacementGroupServersResponse } -export const unmarshalSetSecurityGroupResponse = (data: unknown): SetSecurityGroupResponse => { +export const unmarshalSetSecurityGroupResponse = ( + data: unknown, +): SetSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -1332,11 +1498,15 @@ export const unmarshalSetSecurityGroupResponse = (data: unknown): SetSecurityGro } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, + securityGroup: data.security_group + ? unmarshalSecurityGroup(data.security_group) + : undefined, } as SetSecurityGroupResponse } -export const unmarshalSetSecurityGroupRuleResponse = (data: unknown): SetSecurityGroupRuleResponse => { +export const unmarshalSetSecurityGroupRuleResponse = ( + data: unknown, +): SetSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -1348,7 +1518,9 @@ export const unmarshalSetSecurityGroupRuleResponse = (data: unknown): SetSecurit } as SetSecurityGroupRuleResponse } -export const unmarshalSetSecurityGroupRulesResponse = (data: unknown): SetSecurityGroupRulesResponse => { +export const unmarshalSetSecurityGroupRulesResponse = ( + data: unknown, +): SetSecurityGroupRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSecurityGroupRulesResponse' failed as data isn't a dictionary.`, @@ -1360,7 +1532,9 @@ export const unmarshalSetSecurityGroupRulesResponse = (data: unknown): SetSecuri } as SetSecurityGroupRulesResponse } -export const unmarshalSetServerResponse = (data: unknown): SetServerResponse => { +export const unmarshalSetServerResponse = ( + data: unknown, +): SetServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetServerResponse' failed as data isn't a dictionary.`, @@ -1372,7 +1546,9 @@ export const unmarshalSetServerResponse = (data: unknown): SetServerResponse => } as SetServerResponse } -export const unmarshalSetSnapshotResponse = (data: unknown): SetSnapshotResponse => { +export const unmarshalSetSnapshotResponse = ( + data: unknown, +): SetSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetSnapshotResponse' failed as data isn't a dictionary.`, @@ -1384,7 +1560,9 @@ export const unmarshalSetSnapshotResponse = (data: unknown): SetSnapshotResponse } as SetSnapshotResponse } -export const unmarshalUpdateImageResponse = (data: unknown): UpdateImageResponse => { +export const unmarshalUpdateImageResponse = ( + data: unknown, +): UpdateImageResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateImageResponse' failed as data isn't a dictionary.`, @@ -1408,7 +1586,9 @@ export const unmarshalUpdateIpResponse = (data: unknown): UpdateIpResponse => { } as UpdateIpResponse } -export const unmarshalUpdatePlacementGroupResponse = (data: unknown): UpdatePlacementGroupResponse => { +export const unmarshalUpdatePlacementGroupResponse = ( + data: unknown, +): UpdatePlacementGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdatePlacementGroupResponse' failed as data isn't a dictionary.`, @@ -1416,11 +1596,15 @@ export const unmarshalUpdatePlacementGroupResponse = (data: unknown): UpdatePlac } return { - placementGroup: data.placement_group ? unmarshalPlacementGroup(data.placement_group) : undefined, + placementGroup: data.placement_group + ? unmarshalPlacementGroup(data.placement_group) + : undefined, } as UpdatePlacementGroupResponse } -export const unmarshalUpdatePlacementGroupServersResponse = (data: unknown): UpdatePlacementGroupServersResponse => { +export const unmarshalUpdatePlacementGroupServersResponse = ( + data: unknown, +): UpdatePlacementGroupServersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdatePlacementGroupServersResponse' failed as data isn't a dictionary.`, @@ -1428,11 +1612,16 @@ export const unmarshalUpdatePlacementGroupServersResponse = (data: unknown): Upd } return { - servers: unmarshalArrayOfObject(data.servers, unmarshalPlacementGroupServer), + servers: unmarshalArrayOfObject( + data.servers, + unmarshalPlacementGroupServer, + ), } as UpdatePlacementGroupServersResponse } -export const unmarshalUpdateSecurityGroupResponse = (data: unknown): UpdateSecurityGroupResponse => { +export const unmarshalUpdateSecurityGroupResponse = ( + data: unknown, +): UpdateSecurityGroupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSecurityGroupResponse' failed as data isn't a dictionary.`, @@ -1440,11 +1629,15 @@ export const unmarshalUpdateSecurityGroupResponse = (data: unknown): UpdateSecur } return { - securityGroup: data.security_group ? unmarshalSecurityGroup(data.security_group) : undefined, + securityGroup: data.security_group + ? unmarshalSecurityGroup(data.security_group) + : undefined, } as UpdateSecurityGroupResponse } -export const unmarshalUpdateSecurityGroupRuleResponse = (data: unknown): UpdateSecurityGroupRuleResponse => { +export const unmarshalUpdateSecurityGroupRuleResponse = ( + data: unknown, +): UpdateSecurityGroupRuleResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSecurityGroupRuleResponse' failed as data isn't a dictionary.`, @@ -1456,7 +1649,9 @@ export const unmarshalUpdateSecurityGroupRuleResponse = (data: unknown): UpdateS } as UpdateSecurityGroupRuleResponse } -export const unmarshalUpdateServerResponse = (data: unknown): UpdateServerResponse => { +export const unmarshalUpdateServerResponse = ( + data: unknown, +): UpdateServerResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateServerResponse' failed as data isn't a dictionary.`, @@ -1468,7 +1663,9 @@ export const unmarshalUpdateServerResponse = (data: unknown): UpdateServerRespon } as UpdateServerResponse } -export const unmarshalUpdateSnapshotResponse = (data: unknown): UpdateSnapshotResponse => { +export const unmarshalUpdateSnapshotResponse = ( + data: unknown, +): UpdateSnapshotResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateSnapshotResponse' failed as data isn't a dictionary.`, @@ -1480,7 +1677,9 @@ export const unmarshalUpdateSnapshotResponse = (data: unknown): UpdateSnapshotRe } as UpdateSnapshotResponse } -export const unmarshalUpdateVolumeResponse = (data: unknown): UpdateVolumeResponse => { +export const unmarshalUpdateVolumeResponse = ( + data: unknown, +): UpdateVolumeResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'UpdateVolumeResponse' failed as data isn't a dictionary.`, @@ -1496,14 +1695,10 @@ export const marshalApplyBlockMigrationRequest = ( request: ApplyBlockMigrationRequest, defaults: DefaultValues, ): Record => ({ - validation_key: request.validationKey, + validation_key: request.validationKey, ...resolveOneOf([ - {param: 'volume_id', - value: request.volumeId, - }, - {param: 'snapshot_id', - value: request.snapshotId, - }, + { param: 'volume_id', value: request.volumeId }, + { param: 'snapshot_id', value: request.snapshotId }, ]), }) @@ -1537,14 +1732,10 @@ const marshalVolumeTemplate = ( id: request.id, name: request.name, size: request.size, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - {param: 'project', - value: request.project, - }, - {param: 'organization', - value: request.organization, - }, + { param: 'project', value: request.project }, + { param: 'organization', value: request.organization }, ]), }) @@ -1553,16 +1744,29 @@ export const marshalCreateImageRequest = ( defaults: DefaultValues, ): Record => ({ arch: request.arch, - extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeTemplate(value, defaults) }), {}): undefined), + extra_volumes: + request.extraVolumes !== undefined + ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeTemplate(value, defaults), + }), + {}, + ) + : undefined, name: request.name || randomName('img'), public: request.public, root_volume: request.rootVolume, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, ]), @@ -1574,12 +1778,16 @@ export const marshalCreateIpRequest = ( ): Record => ({ server: request.server, tags: request.tags, - type: request.type, + type: request.type, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, ]), @@ -1592,12 +1800,16 @@ export const marshalCreatePlacementGroupRequest = ( name: request.name || randomName('pg'), policy_mode: request.policyMode, policy_type: request.policyType, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, ]), @@ -1623,22 +1835,22 @@ export const marshalCreateSecurityGroupRequest = ( name: request.name || randomName('sg'), outbound_default_policy: request.outboundDefaultPolicy, stateful: request.stateful, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, - ]), + ]), ...resolveOneOf([ - {param: 'organization_default', - value: request.organizationDefault, - }, - {param: 'project_default', - value: request.projectDefault, - }, + { param: 'organization_default', value: request.organizationDefault }, + { param: 'project_default', value: request.projectDefault }, ]), }) @@ -1688,12 +1900,25 @@ export const marshalCreateServerRequest = ( routed_ip_enabled: request.routedIpEnabled, security_group: request.securityGroup, tags: request.tags, - volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value, defaults) }), {}): undefined), + volumes: + request.volumes !== undefined + ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeServerTemplate(value, defaults), + }), + {}, + ) + : undefined, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, ]), @@ -1709,12 +1934,16 @@ export const marshalCreateSnapshotRequest = ( size: request.size, tags: request.tags, volume_id: request.volumeId, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, ]), @@ -1726,22 +1955,22 @@ export const marshalCreateVolumeRequest = ( ): Record => ({ name: request.name || randomName('vol'), tags: request.tags, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project', + { + default: defaults.defaultProjectId, + param: 'project', value: request.project, }, - {default: defaults.defaultOrganizationId,param: 'organization', + { + default: defaults.defaultOrganizationId, + param: 'organization', value: request.organization, }, - ]), + ]), ...resolveOneOf([ - {param: 'size', - value: request.size, - }, - {param: 'base_snapshot', - value: request.baseSnapshot, - }, + { param: 'size', value: request.size }, + { param: 'base_snapshot', value: request.baseSnapshot }, ]), }) @@ -1770,14 +1999,10 @@ export const marshalExportSnapshotRequest = ( export const marshalPlanBlockMigrationRequest = ( request: PlanBlockMigrationRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'volume_id', - value: request.volumeId, - }, - {param: 'snapshot_id', - value: request.snapshotId, - }, + { param: 'volume_id', value: request.volumeId }, + { param: 'snapshot_id', value: request.snapshotId }, ]), }) @@ -1795,7 +2020,19 @@ export const marshalServerActionRequest = ( action: request.action, disable_ipv6: request.disableIpv6, name: request.name, - volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalServerActionRequestVolumeBackupTemplate(value, defaults) }), {}): undefined), + volumes: + request.volumes !== undefined + ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalServerActionRequestVolumeBackupTemplate( + value, + defaults, + ), + }), + {}, + ) + : undefined, }) const marshalServerSummary = ( @@ -1834,7 +2071,10 @@ const marshalVolume = ( name: request.name, organization: request.organization, project: request.project, - server: ((request.server !== undefined) ? marshalServerSummary(request.server, defaults): undefined), + server: + request.server !== undefined + ? marshalServerSummary(request.server, defaults) + : undefined, size: request.size, state: request.state, tags: request.tags, @@ -1858,15 +2098,30 @@ export const marshalSetImageRequest = ( ): Record => ({ arch: request.arch, creation_date: request.creationDate, - default_bootscript: ((request.defaultBootscript !== undefined) ? marshalBootscript(request.defaultBootscript, defaults): undefined), - extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}): undefined), + default_bootscript: + request.defaultBootscript !== undefined + ? marshalBootscript(request.defaultBootscript, defaults) + : undefined, + extra_volumes: + request.extraVolumes !== undefined + ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolume(value, defaults), + }), + {}, + ) + : undefined, from_server: request.fromServer, modification_date: request.modificationDate, name: request.name, organization: request.organization ?? defaults.defaultOrganizationId, project: request.project ?? defaults.defaultProjectId, public: request.public, - root_volume: ((request.rootVolume !== undefined) ? marshalVolumeSummary(request.rootVolume, defaults): undefined), + root_volume: + request.rootVolume !== undefined + ? marshalVolumeSummary(request.rootVolume, defaults) + : undefined, state: request.state, tags: request.tags, }) @@ -1905,7 +2160,10 @@ export const marshalSetSecurityGroupRequest = ( outbound_default_policy: request.outboundDefaultPolicy, project: request.project ?? defaults.defaultProjectId, project_default: request.projectDefault, - servers: ((request.servers !== undefined) ? request.servers.map(elt => marshalServerSummary(elt, defaults)): undefined), + servers: + request.servers !== undefined + ? request.servers.map(elt => marshalServerSummary(elt, defaults)) + : undefined, stateful: request.stateful, tags: request.tags, }) @@ -1945,7 +2203,12 @@ export const marshalSetSecurityGroupRulesRequest = ( request: SetSecurityGroupRulesRequest, defaults: DefaultValues, ): Record => ({ - rules: ((request.rules !== undefined) ? request.rules.map(elt => marshalSetSecurityGroupRulesRequestRule(elt, defaults)): undefined), + rules: + request.rules !== undefined + ? request.rules.map(elt => + marshalSetSecurityGroupRulesRequestRule(elt, defaults), + ) + : undefined, }) const marshalImage = ( @@ -1954,8 +2217,14 @@ const marshalImage = ( ): Record => ({ arch: request.arch, creation_date: request.creationDate, - default_bootscript: ((request.defaultBootscript !== undefined) ? marshalBootscript(request.defaultBootscript, defaults): undefined), - extra_volumes: Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}), + default_bootscript: + request.defaultBootscript !== undefined + ? marshalBootscript(request.defaultBootscript, defaults) + : undefined, + extra_volumes: Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), + {}, + ), from_server: request.fromServer, id: request.id, modification_date: request.modificationDate, @@ -1963,7 +2232,10 @@ const marshalImage = ( organization: request.organization, project: request.project, public: request.public, - root_volume: ((request.rootVolume !== undefined) ? marshalVolumeSummary(request.rootVolume, defaults): undefined), + root_volume: + request.rootVolume !== undefined + ? marshalVolumeSummary(request.rootVolume, defaults) + : undefined, state: request.state, tags: request.tags, zone: request.zone, @@ -2055,7 +2327,8 @@ export const marshalSetServerRequest = ( defaults: DefaultValues, ): Record => ({ admin_password_encryption_ssh_key_id: request.adminPasswordEncryptionSshKeyId, - allowed_actions: ((request.allowedActions !== undefined) ? request.allowedActions: undefined), + allowed_actions: + request.allowedActions !== undefined ? request.allowedActions : undefined, arch: request.arch, boot_type: request.bootType, commercial_type: request.commercialType, @@ -2063,26 +2336,62 @@ export const marshalSetServerRequest = ( dynamic_ip_required: request.dynamicIpRequired, enable_ipv6: request.enableIpv6, hostname: request.hostname, - image: ((request.image !== undefined) ? marshalImage(request.image, defaults): undefined), - ipv6: ((request.ipv6 !== undefined) ? marshalServerIpv6(request.ipv6, defaults): undefined), - location: ((request.location !== undefined) ? marshalServerLocation(request.location, defaults): undefined), - maintenances: ((request.maintenances !== undefined) ? request.maintenances.map(elt => marshalServerMaintenance(elt, defaults)): undefined), + image: + request.image !== undefined + ? marshalImage(request.image, defaults) + : undefined, + ipv6: + request.ipv6 !== undefined + ? marshalServerIpv6(request.ipv6, defaults) + : undefined, + location: + request.location !== undefined + ? marshalServerLocation(request.location, defaults) + : undefined, + maintenances: + request.maintenances !== undefined + ? request.maintenances.map(elt => marshalServerMaintenance(elt, defaults)) + : undefined, modification_date: request.modificationDate, name: request.name, organization: request.organization ?? defaults.defaultOrganizationId, - placement_group: ((request.placementGroup !== undefined) ? marshalPlacementGroup(request.placementGroup, defaults): undefined), + placement_group: + request.placementGroup !== undefined + ? marshalPlacementGroup(request.placementGroup, defaults) + : undefined, private_ip: request.privateIp, - private_nics: ((request.privateNics !== undefined) ? request.privateNics.map(elt => marshalPrivateNIC(elt, defaults)): undefined), + private_nics: + request.privateNics !== undefined + ? request.privateNics.map(elt => marshalPrivateNIC(elt, defaults)) + : undefined, project: request.project ?? defaults.defaultProjectId, protected: request.protected, - public_ip: ((request.publicIp !== undefined) ? marshalServerIp(request.publicIp, defaults): undefined), - public_ips: ((request.publicIps !== undefined) ? request.publicIps.map(elt => marshalServerIp(elt, defaults)): undefined), + public_ip: + request.publicIp !== undefined + ? marshalServerIp(request.publicIp, defaults) + : undefined, + public_ips: + request.publicIps !== undefined + ? request.publicIps.map(elt => marshalServerIp(elt, defaults)) + : undefined, routed_ip_enabled: request.routedIpEnabled, - security_group: ((request.securityGroup !== undefined) ? marshalSecurityGroupSummary(request.securityGroup, defaults): undefined), + security_group: + request.securityGroup !== undefined + ? marshalSecurityGroupSummary(request.securityGroup, defaults) + : undefined, state: request.state, state_detail: request.stateDetail, tags: request.tags, - volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolume(value, defaults) }), {}): undefined), + volumes: + request.volumes !== undefined + ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolume(value, defaults), + }), + {}, + ) + : undefined, }) const marshalSnapshotBaseVolume = ( @@ -2097,7 +2406,10 @@ export const marshalSetSnapshotRequest = ( request: SetSnapshotRequest, defaults: DefaultValues, ): Record => ({ - base_volume: ((request.baseVolume !== undefined) ? marshalSnapshotBaseVolume(request.baseVolume, defaults): undefined), + base_volume: + request.baseVolume !== undefined + ? marshalSnapshotBaseVolume(request.baseVolume, defaults) + : undefined, creation_date: request.creationDate, id: request.id, modification_date: request.modificationDate, @@ -2122,7 +2434,16 @@ export const marshalUpdateImageRequest = ( defaults: DefaultValues, ): Record => ({ arch: request.arch, - extra_volumes: ((request.extraVolumes !== undefined) ? Object.entries(request.extraVolumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeImageUpdateTemplate(value, defaults) }), {}): undefined), + extra_volumes: + request.extraVolumes !== undefined + ? Object.entries(request.extraVolumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeImageUpdateTemplate(value, defaults), + }), + {}, + ) + : undefined, name: request.name, public: request.public, tags: request.tags, @@ -2213,9 +2534,21 @@ export const marshalUpdateServerRequest = ( protected: request.protected, public_ips: request.publicIps, routed_ip_enabled: request.routedIpEnabled, - security_group: ((request.securityGroup !== undefined) ? marshalSecurityGroupTemplate(request.securityGroup, defaults): undefined), + security_group: + request.securityGroup !== undefined + ? marshalSecurityGroupTemplate(request.securityGroup, defaults) + : undefined, tags: request.tags, - volumes: ((request.volumes !== undefined) ? Object.entries(request.volumes).reduce((acc, [key, value]) => ({ ...acc, [key]: marshalVolumeServerTemplate(value, defaults) }), {}): undefined), + volumes: + request.volumes !== undefined + ? Object.entries(request.volumes).reduce( + (acc, [key, value]) => ({ + ...acc, + [key]: marshalVolumeServerTemplate(value, defaults), + }), + {}, + ) + : undefined, }) export const marshalUpdateSnapshotRequest = ( diff --git a/packages_generated/instance/src/v1/types.gen.ts b/packages_generated/instance/src/v1/types.gen.ts index 230219940..ce7c0c55b 100644 --- a/packages_generated/instance/src/v1/types.gen.ts +++ b/packages_generated/instance/src/v1/types.gen.ts @@ -1,13 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' +import type { Zone as ScwZone } from '@scaleway/sdk-client' - -export type Arch = - | 'unknown_arch' - | 'x86_64' - | 'arm' - | 'arm64' +export type Arch = 'unknown_arch' | 'x86_64' | 'arm' | 'arm64' export type AttachServerVolumeRequestVolumeType = | 'unknown_volume_type' @@ -15,15 +10,9 @@ export type AttachServerVolumeRequestVolumeType = | 'b_ssd' | 'sbs_volume' -export type BootType = - | 'local' - | 'bootscript' - | 'rescue' +export type BootType = 'local' | 'bootscript' | 'rescue' -export type ImageState = - | 'available' - | 'creating' - | 'error' +export type ImageState = 'available' | 'creating' | 'error' export type IpState = | 'unknown_state' @@ -32,10 +21,7 @@ export type IpState = | 'pending' | 'error' -export type IpType = - | 'unknown_iptype' - | 'routed_ipv4' - | 'routed_ipv6' +export type IpType = 'unknown_iptype' | 'routed_ipv4' | 'routed_ipv6' export type ListServersRequestOrder = | 'creation_date_desc' @@ -43,28 +29,15 @@ export type ListServersRequestOrder = | 'modification_date_desc' | 'modification_date_asc' -export type PlacementGroupPolicyMode = - | 'optional' - | 'enforced' +export type PlacementGroupPolicyMode = 'optional' | 'enforced' -export type PlacementGroupPolicyType = - | 'max_availability' - | 'low_latency' +export type PlacementGroupPolicyType = 'max_availability' | 'low_latency' -export type PrivateNICState = - | 'available' - | 'syncing' - | 'syncing_error' +export type PrivateNICState = 'available' | 'syncing' | 'syncing_error' -export type SecurityGroupPolicy = - | 'unknown_policy' - | 'accept' - | 'drop' +export type SecurityGroupPolicy = 'unknown_policy' | 'accept' | 'drop' -export type SecurityGroupRuleAction = - | 'unknown_action' - | 'accept' - | 'drop' +export type SecurityGroupRuleAction = 'unknown_action' | 'accept' | 'drop' export type SecurityGroupRuleDirection = | 'unknown_direction' @@ -78,10 +51,7 @@ export type SecurityGroupRuleProtocol = | 'ICMP' | 'ANY' -export type SecurityGroupState = - | 'available' - | 'syncing' - | 'syncing_error' +export type SecurityGroupState = 'available' | 'syncing' | 'syncing_error' export type ServerAction = | 'poweron' @@ -98,14 +68,9 @@ export type ServerFilesystemState = | 'available' | 'detaching' -export type ServerIpIpFamily = - | 'inet' - | 'inet6' +export type ServerIpIpFamily = 'inet' | 'inet6' -export type ServerIpProvisioningMode = - | 'manual' - | 'dhcp' - | 'slaac' +export type ServerIpProvisioningMode = 'manual' | 'dhcp' | 'slaac' export type ServerIpState = | 'unknown_state' @@ -122,10 +87,7 @@ export type ServerState = | 'stopping' | 'locked' -export type ServerTypesAvailability = - | 'available' - | 'scarce' - | 'shortage' +export type ServerTypesAvailability = 'available' | 'scarce' | 'shortage' export type SnapshotState = | 'available' @@ -141,12 +103,7 @@ export type SnapshotVolumeType = | 'b_ssd' | 'unified' -export type TaskStatus = - | 'pending' - | 'started' - | 'success' - | 'failure' - | 'retry' +export type TaskStatus = 'pending' | 'started' | 'success' | 'failure' | 'retry' export type VolumeServerState = | 'available' @@ -187,7 +144,6 @@ export interface ServerSummary { name: string } - export interface Bootscript { architecture: Arch bootcmdargs: string @@ -206,7 +162,6 @@ export interface Bootscript { zone: ScwZone } - export interface Volume { /** * Volume unique ID. @@ -258,7 +213,6 @@ export interface Volume { zone: ScwZone } - export interface VolumeSummary { id: string name: string @@ -266,7 +220,6 @@ export interface VolumeSummary { volumeType: VolumeVolumeType } - export interface ServerTypeNetworkInterface { /** * Maximum internal bandwidth in bits per seconds. @@ -278,7 +231,6 @@ export interface ServerTypeNetworkInterface { internetBandwidth?: number } - export interface ServerTypeVolumeConstraintSizes { /** * Minimum volume size in bytes. @@ -290,7 +242,6 @@ export interface ServerTypeVolumeConstraintSizes { maxSize: number } - export interface Image { id: string name: string @@ -298,7 +249,7 @@ export interface Image { creationDate?: Date modificationDate?: Date /** - * @deprecated + * @deprecated */ defaultBootscript?: Bootscript extraVolumes: Record @@ -315,7 +266,6 @@ export interface Image { zone: ScwZone } - export interface PlacementGroup { /** * Placement group unique ID. @@ -356,7 +306,6 @@ In the placement group endpoints the value is correct. zone: ScwZone } - export interface PrivateNIC { /** * Private NIC unique ID. @@ -392,19 +341,16 @@ export interface PrivateNIC { zone: ScwZone } - export interface SecurityGroupSummary { id: string name: string } - export interface ServerFilesystem { filesystemId: string state: ServerFilesystemState } - export interface ServerIp { /** * Unique ID of the IP address. @@ -448,7 +394,6 @@ export interface ServerIp { state: ServerIpState } - export interface ServerIpv6 { /** * Instance IPv6 IP-Address. @@ -464,7 +409,6 @@ export interface ServerIpv6 { netmask: string } - export interface ServerLocation { clusterId: string hypervisorId: string @@ -473,18 +417,16 @@ export interface ServerLocation { zoneId: string } - export interface ServerMaintenance { reason: string startDate?: Date } - export interface VolumeServer { id: string name?: string /** - * @deprecated + * @deprecated */ exportUri?: string organization?: string @@ -502,7 +444,6 @@ export interface VolumeServer { zone: ScwZone } - export interface SnapshotBaseVolume { /** * Volume ID on which the snapshot is based. @@ -514,7 +455,6 @@ export interface SnapshotBaseVolume { name: string } - export interface ServerTypeCapabilities { /** * Defines whether the Instance supports block storage. @@ -530,7 +470,6 @@ export interface ServerTypeCapabilities { maxFileSystems: number } - export interface ServerTypeGPUInfo { /** * GPU manufacturer. @@ -546,7 +485,6 @@ export interface ServerTypeGPUInfo { gpuMemory: number } - export interface ServerTypeNetwork { /** * List of available network interfaces. @@ -566,7 +504,6 @@ export interface ServerTypeNetwork { ipv6Support: boolean } - export interface ServerTypeVolumeConstraintsByType { /** * Local SSD volumes. @@ -574,18 +511,15 @@ export interface ServerTypeVolumeConstraintsByType { lSsd?: ServerTypeVolumeConstraintSizes } - export interface VolumeTypeCapabilities { snapshot: boolean } - export interface VolumeTypeConstraints { min: number max: number } - export interface Server { /** * Instance unique ID. @@ -729,7 +663,6 @@ export interface Server { endOfService: boolean } - export interface VolumeTemplate { /** * UUID of the volume. @@ -761,7 +694,6 @@ export interface VolumeTemplate { project?: string } - export interface Ip { id: string address: string @@ -780,7 +712,6 @@ export interface Ip { zone: ScwZone } - export interface SecurityGroup { /** * Security group unique ID. @@ -852,7 +783,6 @@ export interface SecurityGroup { zone: ScwZone } - export interface SecurityGroupRule { id: string protocol: SecurityGroupRuleProtocol @@ -869,7 +799,6 @@ export interface SecurityGroupRule { zone: ScwZone } - export interface VolumeServerTemplate { /** * UUID of the volume. @@ -905,7 +834,6 @@ export interface VolumeServerTemplate { project?: string } - export interface Snapshot { /** * Snapshot ID. @@ -961,7 +889,6 @@ export interface Snapshot { errorReason?: string } - export interface Task { /** * Unique ID of the task. @@ -995,7 +922,6 @@ export interface Task { zone: ScwZone } - export interface Dashboard { volumesCount: number runningServersCount: number @@ -1008,19 +934,18 @@ export interface Dashboard { ipsUnused: number volumesLSsdCount: number /** - * @deprecated + * @deprecated */ volumesBSsdCount?: number volumesLSsdTotalSize: number /** - * @deprecated + * @deprecated */ volumesBSsdTotalSize?: number privateNicsCount: number placementGroupsCount: number } - export interface PlacementGroupServer { /** * Instance UUID. @@ -1036,12 +961,10 @@ export interface PlacementGroupServer { policyRespected: boolean } - export interface GetServerTypesAvailabilityResponseAvailability { availability: ServerTypesAvailability } - export interface ServerType { /** * @deprecated Estimated monthly price, for a 30 days month, in Euro. @@ -1105,14 +1028,12 @@ export interface ServerType { endOfService: boolean } - export interface VolumeType { displayName: string capabilities?: VolumeTypeCapabilities constraints?: VolumeTypeConstraints } - export interface ServerActionRequestVolumeBackupTemplate { /** * Overrides the `volume_type` of the snapshot for this volume. @@ -1121,7 +1042,6 @@ If omitted, the volume type of the original volume will be used. volumeType: SnapshotVolumeType } - export interface SetSecurityGroupRulesRequestRule { /** * UUID of the security rule to update. If no value is provided, a new rule will be created. @@ -1165,7 +1085,6 @@ export interface SetSecurityGroupRulesRequestRule { zone?: ScwZone } - export interface VolumeImageUpdateTemplate { /** * UUID of the snapshot. @@ -1173,13 +1092,11 @@ export interface VolumeImageUpdateTemplate { id: string } - export interface SecurityGroupTemplate { id: string name: string } - export type ApplyBlockMigrationRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1203,7 +1120,6 @@ export type ApplyBlockMigrationRequest = { validationKey: string } - export type AttachServerFileSystemRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1213,12 +1129,10 @@ export type AttachServerFileSystemRequest = { filesystemId: string } - export interface AttachServerFileSystemResponse { server?: Server } - export type AttachServerVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1230,12 +1144,10 @@ export type AttachServerVolumeRequest = { boot?: boolean } - export interface AttachServerVolumeResponse { server?: Server } - export type CheckBlockMigrationOrganizationQuotasRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1244,7 +1156,6 @@ export type CheckBlockMigrationOrganizationQuotasRequest = { organization?: string } - export type CreateImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1288,12 +1199,10 @@ export type CreateImageRequest = { public?: boolean } - export interface CreateImageResponse { image?: Image } - export type CreateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1325,12 +1234,10 @@ export type CreateIpRequest = { type?: IpType } - export interface CreateIpResponse { ip?: Ip } - export type CreatePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1366,12 +1273,10 @@ export type CreatePlacementGroupRequest = { policyType?: PlacementGroupPolicyType } - export interface CreatePlacementGroupResponse { placementGroup?: PlacementGroup } - export type CreatePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1399,12 +1304,10 @@ export type CreatePrivateNICRequest = { ipamIpIds?: string[] } - export interface CreatePrivateNICResponse { privateNic?: PrivateNIC } - export type CreateSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1464,12 +1367,10 @@ export type CreateSecurityGroupRequest = { enableDefaultSecurity?: boolean } - export interface CreateSecurityGroupResponse { securityGroup?: SecurityGroup } - export type CreateSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1501,12 +1402,10 @@ export type CreateSecurityGroupRuleRequest = { editable: boolean } - export interface CreateSecurityGroupRuleResponse { rule?: SecurityGroupRule } - export type CreateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1586,12 +1485,10 @@ export type CreateServerRequest = { protected: boolean } - export interface CreateServerResponse { server?: Server } - export type CreateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1640,13 +1537,11 @@ If omitted, the volume type of the original volume will be used. size?: number } - export interface CreateSnapshotResponse { snapshot?: Snapshot task?: Task } - export type CreateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1690,12 +1585,10 @@ export type CreateVolumeRequest = { baseSnapshot?: string } - export interface CreateVolumeResponse { volume?: Volume } - export type DeleteImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1707,7 +1600,6 @@ export type DeleteImageRequest = { imageId: string } - export type DeleteIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1719,7 +1611,6 @@ export type DeleteIpRequest = { ip: string } - export type DeletePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1731,7 +1622,6 @@ export type DeletePlacementGroupRequest = { placementGroupId: string } - export type DeletePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1747,7 +1637,6 @@ export type DeletePrivateNICRequest = { privateNicId: string } - export type DeleteSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1759,7 +1648,6 @@ export type DeleteSecurityGroupRequest = { securityGroupId: string } - export type DeleteSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1769,7 +1657,6 @@ export type DeleteSecurityGroupRuleRequest = { securityGroupRuleId: string } - export type DeleteServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1778,7 +1665,6 @@ export type DeleteServerRequest = { serverId: string } - export type DeleteServerUserDataRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1794,7 +1680,6 @@ export type DeleteServerUserDataRequest = { key: string } - export type DeleteSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1806,7 +1691,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1818,7 +1702,6 @@ export type DeleteVolumeRequest = { volumeId: string } - export type DetachServerFileSystemRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1828,12 +1711,10 @@ export type DetachServerFileSystemRequest = { filesystemId: string } - export interface DetachServerFileSystemResponse { server?: Server } - export type DetachServerVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1843,12 +1724,10 @@ export type DetachServerVolumeRequest = { volumeId: string } - export interface DetachServerVolumeResponse { server?: Server } - export type ExportSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1868,12 +1747,10 @@ export type ExportSnapshotRequest = { key: string } - export interface ExportSnapshotResponse { task?: Task } - export type GetDashboardRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1883,12 +1760,10 @@ export type GetDashboardRequest = { project?: string } - export interface GetDashboardResponse { dashboard?: Dashboard } - export type GetImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1900,12 +1775,10 @@ export type GetImageRequest = { imageId: string } - export interface GetImageResponse { image?: Image } - export type GetIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1917,12 +1790,10 @@ export type GetIpRequest = { ip: string } - export interface GetIpResponse { ip?: Ip } - export type GetPlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1934,12 +1805,10 @@ export type GetPlacementGroupRequest = { placementGroupId: string } - export interface GetPlacementGroupResponse { placementGroup?: PlacementGroup } - export type GetPlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1951,7 +1820,6 @@ export type GetPlacementGroupServersRequest = { placementGroupId: string } - export interface GetPlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -1959,7 +1827,6 @@ export interface GetPlacementGroupServersResponse { servers: PlacementGroupServer[] } - export type GetPrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1975,12 +1842,10 @@ export type GetPrivateNICRequest = { privateNicId: string } - export interface GetPrivateNICResponse { privateNic?: PrivateNIC } - export type GetSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1992,12 +1857,10 @@ export type GetSecurityGroupRequest = { securityGroupId: string } - export interface GetSecurityGroupResponse { securityGroup?: SecurityGroup } - export type GetSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2007,12 +1870,10 @@ export type GetSecurityGroupRuleRequest = { securityGroupRuleId: string } - export interface GetSecurityGroupRuleResponse { rule?: SecurityGroupRule } - export type GetServerCompatibleTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2024,7 +1885,6 @@ export type GetServerCompatibleTypesRequest = { serverId: string } - export type GetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2036,12 +1896,10 @@ export type GetServerRequest = { serverId: string } - export interface GetServerResponse { server?: Server } - export type GetServerTypesAvailabilityRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2057,7 +1915,6 @@ export type GetServerTypesAvailabilityRequest = { page?: number } - export interface GetServerTypesAvailabilityResponse { /** * Map of server types. @@ -2066,7 +1923,6 @@ export interface GetServerTypesAvailabilityResponse { totalCount: number } - export type GetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2078,12 +1934,10 @@ export type GetSnapshotRequest = { snapshotId: string } - export interface GetSnapshotResponse { snapshot?: Snapshot } - export type GetVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2095,12 +1949,10 @@ export type GetVolumeRequest = { volumeId: string } - export interface GetVolumeResponse { volume?: Volume } - export type ListDefaultSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2108,7 +1960,6 @@ export type ListDefaultSecurityGroupRulesRequest = { zone?: ScwZone } - export type ListImagesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2124,7 +1975,6 @@ export type ListImagesRequest = { tags?: string } - export interface ListImagesResponse { /** * Total number of images. @@ -2136,7 +1986,6 @@ export interface ListImagesResponse { images: Image[] } - export type ListIpsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2172,7 +2021,6 @@ export type ListIpsRequest = { type?: string } - export interface ListIpsResponse { /** * Total number of ips. @@ -2184,7 +2032,6 @@ export interface ListIpsResponse { ips: Ip[] } - export type ListPlacementGroupsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2216,7 +2063,6 @@ export type ListPlacementGroupsRequest = { name?: string } - export interface ListPlacementGroupsResponse { /** * Total number of placement groups. @@ -2228,7 +2074,6 @@ export interface ListPlacementGroupsResponse { placementGroups: PlacementGroup[] } - export type ListPrivateNICsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2252,13 +2097,11 @@ export type ListPrivateNICsRequest = { page?: number } - export interface ListPrivateNICsResponse { privateNics: PrivateNIC[] totalCount: number } - export type ListSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2278,7 +2121,6 @@ export type ListSecurityGroupRulesRequest = { page?: number } - export interface ListSecurityGroupRulesResponse { /** * Total number of security groups. @@ -2290,7 +2132,6 @@ export interface ListSecurityGroupRulesResponse { rules: SecurityGroupRule[] } - export type ListSecurityGroupsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2326,7 +2167,6 @@ export type ListSecurityGroupsRequest = { page?: number } - export interface ListSecurityGroupsResponse { /** * Total number of security groups. @@ -2338,7 +2178,6 @@ export interface ListSecurityGroupsResponse { securityGroups: SecurityGroup[] } - export type ListServerActionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2347,12 +2186,10 @@ export type ListServerActionsRequest = { serverId: string } - export interface ListServerActionsResponse { actions: ServerAction[] } - export type ListServerUserDataRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2364,12 +2201,10 @@ export type ListServerUserDataRequest = { serverId: string } - export interface ListServerUserDataResponse { userData: string[] } - export type ListServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2441,7 +2276,6 @@ export type ListServersRequest = { servers?: string[] } - export interface ListServersResponse { /** * Total number of Instances. @@ -2453,7 +2287,6 @@ export interface ListServersResponse { servers: Server[] } - export type ListServersTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2463,7 +2296,6 @@ export type ListServersTypesRequest = { page?: number } - export interface ListServersTypesResponse { /** * Total number of Instance types. @@ -2475,7 +2307,6 @@ export interface ListServersTypesResponse { servers: Record } - export type ListSnapshotsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2511,7 +2342,6 @@ export type ListSnapshotsRequest = { baseVolumeId?: string } - export interface ListSnapshotsResponse { /** * Total number of snapshots. @@ -2523,7 +2353,6 @@ export interface ListSnapshotsResponse { snapshots: Snapshot[] } - export type ListVolumesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2559,7 +2388,6 @@ export type ListVolumesRequest = { name?: string } - export interface ListVolumesResponse { /** * Total number of volumes. @@ -2571,7 +2399,6 @@ export interface ListVolumesResponse { volumes: Volume[] } - export type ListVolumesTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2581,7 +2408,6 @@ export type ListVolumesTypesRequest = { page?: number } - export interface ListVolumesTypesResponse { /** * Total number of volume types. @@ -2593,7 +2419,6 @@ export interface ListVolumesTypesResponse { volumes: Record } - export interface MigrationPlan { /** * A volume which will be migrated to SBS together with the snapshots, if present. @@ -2609,7 +2434,6 @@ export interface MigrationPlan { validationKey: string } - export type PlanBlockMigrationRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2629,7 +2453,6 @@ export type PlanBlockMigrationRequest = { snapshotId?: string } - export type ReleaseIpToIpamRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2641,7 +2464,6 @@ export type ReleaseIpToIpamRequest = { ipId: string } - export type ServerActionRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2672,12 +2494,10 @@ This field should only be specified when performing a enable_routed_ip action. disableIpv6?: boolean } - export interface ServerActionResponse { task?: Task } - export interface ServerCompatibleTypes { /** * Instance compatible types. @@ -2685,7 +2505,6 @@ export interface ServerCompatibleTypes { compatibleTypes: string[] } - export type SetImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2697,7 +2516,7 @@ export type SetImageRequest = { creationDate?: Date modificationDate?: Date /** - * @deprecated + * @deprecated */ defaultBootscript?: Bootscript extraVolumes?: Record @@ -2710,7 +2529,6 @@ export type SetImageRequest = { tags?: string[] } - export type SetPlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2725,12 +2543,10 @@ export type SetPlacementGroupRequest = { tags?: string[] } - export interface SetPlacementGroupResponse { placementGroup?: PlacementGroup } - export type SetPlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2746,7 +2562,6 @@ export type SetPlacementGroupServersRequest = { servers: string[] } - export interface SetPlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -2754,7 +2569,6 @@ export interface SetPlacementGroupServersResponse { servers: PlacementGroupServer[] } - export type SetSecurityGroupRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2770,12 +2584,10 @@ export type SetSecurityGroupRulesRequest = { rules?: SetSecurityGroupRulesRequestRule[] } - export interface SetSecurityGroupRulesResponse { rules: SecurityGroupRule[] } - export type UpdateImageRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2807,12 +2619,10 @@ export type UpdateImageRequest = { public?: boolean } - export interface UpdateImageResponse { image?: Image } - export type UpdateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2837,12 +2647,10 @@ export type UpdateIpRequest = { server?: string | null } - export interface UpdateIpResponse { ip?: Ip } - export type UpdatePlacementGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2870,12 +2678,10 @@ export type UpdatePlacementGroupRequest = { policyType?: PlacementGroupPolicyType } - export interface UpdatePlacementGroupResponse { placementGroup?: PlacementGroup } - export type UpdatePlacementGroupServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2891,7 +2697,6 @@ export type UpdatePlacementGroupServersRequest = { servers: string[] } - export interface UpdatePlacementGroupServersResponse { /** * Instances attached to the placement group. @@ -2899,7 +2704,6 @@ export interface UpdatePlacementGroupServersResponse { servers: PlacementGroupServer[] } - export type UpdatePrivateNICRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2919,7 +2723,6 @@ export type UpdatePrivateNICRequest = { tags?: string[] } - export type UpdateSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2967,12 +2770,10 @@ export type UpdateSecurityGroupRequest = { stateful?: boolean } - export interface UpdateSecurityGroupResponse { securityGroup?: SecurityGroup } - export type UpdateSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3016,12 +2817,10 @@ export type UpdateSecurityGroupRuleRequest = { position?: number } - export interface UpdateSecurityGroupRuleResponse { rule?: SecurityGroupRule } - export type UpdateServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3051,7 +2850,7 @@ export type UpdateServerRequest = { */ publicIps?: string[] /** - * @deprecated + * @deprecated */ enableIpv6?: boolean /** @@ -3081,12 +2880,10 @@ export type UpdateServerRequest = { adminPasswordEncryptionSshKeyId?: string } - export interface UpdateServerResponse { server?: Server } - export type UpdateSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3106,12 +2903,10 @@ export type UpdateSnapshotRequest = { tags?: string[] } - export interface UpdateSnapshotResponse { snapshot?: Snapshot } - export type UpdateVolumeRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3135,9 +2930,6 @@ export type UpdateVolumeRequest = { size?: number } - export interface UpdateVolumeResponse { volume?: Volume } - - diff --git a/packages_generated/instance/src/v1/types.private.gen.ts b/packages_generated/instance/src/v1/types.private.gen.ts index 94775bca5..bfd431003 100644 --- a/packages_generated/instance/src/v1/types.private.gen.ts +++ b/packages_generated/instance/src/v1/types.private.gen.ts @@ -1,14 +1,38 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import type { Zone as ScwZone } from '@scaleway/sdk-client' -import type {Arch,BootType,SecurityGroupPolicy,SecurityGroupRuleAction,SecurityGroupRuleDirection,SecurityGroupRuleProtocol,ServerAction,ServerState,SnapshotState,VolumeVolumeType,ServerSummary,Volume,Image,PlacementGroup,PrivateNIC,SecurityGroupSummary,ServerIp,ServerIpv6,ServerLocation,ServerMaintenance,SnapshotBaseVolume,Server,SecurityGroup,SecurityGroupRule,Snapshot,} from './types.gen.js' - +import type { + Arch, + BootType, + SecurityGroupPolicy, + SecurityGroupRuleAction, + SecurityGroupRuleDirection, + SecurityGroupRuleProtocol, + ServerAction, + ServerState, + SnapshotState, + VolumeVolumeType, + ServerSummary, + Volume, + Image, + PlacementGroup, + PrivateNIC, + SecurityGroupSummary, + ServerIp, + ServerIpv6, + ServerLocation, + ServerMaintenance, + SnapshotBaseVolume, + Server, + SecurityGroup, + SecurityGroupRule, + Snapshot, +} from './types.gen.js' export interface SetImageResponse { image?: Image } - export type SetSecurityGroupRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -76,12 +100,10 @@ export type SetSecurityGroupRequest = { stateful: boolean } - export interface SetSecurityGroupResponse { securityGroup?: SecurityGroup } - export type SetSecurityGroupRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -100,12 +122,10 @@ export type SetSecurityGroupRuleRequest = { editable: boolean } - export interface SetSecurityGroupRuleResponse { rule?: SecurityGroupRule } - export type SetServerRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -233,12 +253,10 @@ export type SetServerRequest = { adminPasswordEncryptionSshKeyId?: string } - export interface SetServerResponse { server?: Server } - export type SetSnapshotRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -258,9 +276,6 @@ export type SetSnapshotRequest = { tags?: string[] } - export interface SetSnapshotResponse { snapshot?: Snapshot } - - diff --git a/packages_generated/interlink/src/v1beta1/api.gen.ts b/packages_generated/interlink/src/v1beta1/api.gen.ts index c12eac825..86b5d06e3 100644 --- a/packages_generated/interlink/src/v1beta1/api.gen.ts +++ b/packages_generated/interlink/src/v1beta1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DEDICATED_CONNECTION_TRANSIENT_STATUSES as DEDICATED_CONNECTION_TRANSIENT_STATUSES_INTERLINK,LINK_TRANSIENT_STATUSES as LINK_TRANSIENT_STATUSES_INTERLINK,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + DEDICATED_CONNECTION_TRANSIENT_STATUSES as DEDICATED_CONNECTION_TRANSIENT_STATUSES_INTERLINK, + LINK_TRANSIENT_STATUSES as LINK_TRANSIENT_STATUSES_INTERLINK, +} from './content.gen.js' import { marshalAttachRoutingPolicyRequest, marshalAttachVpcRequest, @@ -80,16 +83,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListDedicatedConnections = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListDedicatedConnections = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -100,7 +100,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['pop_id', request.popId], ['project_id', request.projectId], ['status', request.status], @@ -109,17 +112,22 @@ export class API extends ParentAPI { }, unmarshalListDedicatedConnectionsResponse, ) - + /** * List dedicated connections. For self-hosted users, list their dedicated physical connections in a given region. By default, the connections returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field. * * @param request - The request {@link ListDedicatedConnectionsRequest} * @returns A Promise of ListDedicatedConnectionsResponse */ - listDedicatedConnections = (request: Readonly = {}) => - enrichForPagination('connections', this.pageOfListDedicatedConnections, request) + listDedicatedConnections = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'connections', + this.pageOfListDedicatedConnections, + request, + ) - /** * Get a dedicated connection. For self-hosted users, get a dedicated physical connection corresponding to the given ID. The response object includes information such as the connection's name, status and total bandwidth. * @@ -134,7 +142,7 @@ export class API extends ParentAPI { }, unmarshalDedicatedConnection, ) - + /** * Waits for {@link DedicatedConnection} to be in a final state. * @@ -147,14 +155,21 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DEDICATED_CONNECTION_TRANSIENT_STATUSES_INTERLINK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DEDICATED_CONNECTION_TRANSIENT_STATUSES_INTERLINK.includes( + res.status, + ), + )), this.getDedicatedConnection, request, options, ) - - protected pageOfListPartners = (request: Readonly = {}) => + protected pageOfListPartners = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -162,13 +177,16 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['pop_ids', request.popIds], ), }, unmarshalListPartnersResponse, ) - + /** * List available partners. List all available partners. By default, the partners returned in the list are ordered by name in ascending order, though this can be modified via the `order_by` field. * @@ -178,7 +196,6 @@ export class API extends ParentAPI { listPartners = (request: Readonly = {}) => enrichForPagination('partners', this.pageOfListPartners, request) - /** * Get a partner. Get a partner for the given partner IP. The response object includes information such as the partner's name, email address and portal URL. * @@ -194,7 +211,6 @@ export class API extends ParentAPI { unmarshalPartner, ) - protected pageOfListPops = (request: Readonly = {}) => this.client.fetch( { @@ -207,13 +223,16 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['partner_id', request.partnerId], ), }, unmarshalListPopsResponse, ) - + /** * List PoPs. List all available PoPs (locations) for a given region. By default, the results are returned in ascending alphabetical order by name. * @@ -223,7 +242,6 @@ export class API extends ParentAPI { listPops = (request: Readonly = {}) => enrichForPagination('pops', this.pageOfListPops, request) - /** * Get a PoP. Get a PoP for the given PoP ID. The response object includes the PoP's name and information about its physical location. * @@ -239,7 +257,6 @@ export class API extends ParentAPI { unmarshalPop, ) - protected pageOfListLinks = (request: Readonly = {}) => this.client.fetch( { @@ -255,7 +272,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['pairing_key', request.pairingKey], ['partner_id', request.partnerId], ['pop_id', request.popId], @@ -268,7 +288,7 @@ export class API extends ParentAPI { }, unmarshalListLinksResponse, ) - + /** * List links. List all your links (InterLink connections). A number of filters are available, including Project ID, name, tags and status. * @@ -278,7 +298,6 @@ export class API extends ParentAPI { listLinks = (request: Readonly = {}) => enrichForPagination('links', this.pageOfListLinks, request) - /** * Get a link. Get a link (InterLink session / logical InterLink resource) for the given link ID. The response object includes information about the link's various configuration details. * @@ -293,7 +312,7 @@ export class API extends ParentAPI { }, unmarshalLink, ) - + /** * Waits for {@link Link} to be in a final state. * @@ -306,13 +325,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!LINK_TRANSIENT_STATUSES_INTERLINK.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !LINK_TRANSIENT_STATUSES_INTERLINK.includes(res.status), + )), this.getLink, request, options, ) - /** * Create a link. Create a link (InterLink session / logical InterLink resource) in a given PoP, specifying its various configuration details. Links can either be hosted (facilitated by partners' shared physical connections) or self-hosted (for users who have purchased a dedicated physical connection). * @@ -332,7 +354,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Update a link. Update an existing link, specified by its link ID. Only its name and tags can be updated. * @@ -352,7 +373,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Delete a link. Delete an existing link, specified by its link ID. Note that as well as deleting the link here on the Scaleway side, it is also necessary to request deletion from the partner on their side. Only when this action has been carried out on both sides will the resource be completely deleted. * @@ -368,7 +388,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Attach a VPC. Attach a VPC to an existing link. This facilitates communication between the resources in your Scaleway VPC, and your on-premises infrastructure. * @@ -388,7 +407,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Detach a VPC. Detach a VPC from an existing link. * @@ -406,7 +424,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Attach a routing policy. Attach a routing policy to an existing link. As all routes across the link are blocked by default, you must attach a routing policy to set IP prefix filters for allowed routes, facilitating traffic flow. * @@ -426,7 +443,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Detach a routing policy. Detach a routing policy from an existing link. Without a routing policy, all routes across the link are blocked by default. * @@ -446,7 +462,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Set a routing policy. Replace a routing policy from an existing link. This is useful when route propagation is enabled because it changes the routing policy "in place", without blocking all routes like a attach / detach would do. * @@ -466,7 +481,6 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce. * @@ -484,14 +498,15 @@ export class API extends ParentAPI { unmarshalLink, ) - /** * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the InterLink until route propagation is re-enabled. * * @param request - The request {@link DisableRoutePropagationRequest} * @returns A Promise of Link */ - disableRoutePropagation = (request: Readonly) => + disableRoutePropagation = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -502,8 +517,9 @@ export class API extends ParentAPI { unmarshalLink, ) - - protected pageOfListRoutingPolicies = (request: Readonly = {}) => + protected pageOfListRoutingPolicies = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -514,14 +530,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListRoutingPoliciesResponse, ) - + /** * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple links (InterLink connections). * @@ -529,9 +548,12 @@ export class API extends ParentAPI { * @returns A Promise of ListRoutingPoliciesResponse */ listRoutingPolicies = (request: Readonly = {}) => - enrichForPagination('routingPolicies', this.pageOfListRoutingPolicies, request) + enrichForPagination( + 'routingPolicies', + this.pageOfListRoutingPolicies, + request, + ) - /** * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters. * @@ -547,7 +569,6 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the peer, and the outgoing routes to announce to the peer. * @@ -567,7 +588,6 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated. * @@ -587,20 +607,14 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID. * * @param request - The request {@link DeleteRoutingPolicyRequest} */ deleteRoutingPolicy = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/interlink/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam('routingPolicyId', request.routingPolicyId)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/interlink/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam('routingPolicyId', request.routingPolicyId)}`, + }) } - diff --git a/packages_generated/interlink/src/v1beta1/content.gen.ts b/packages_generated/interlink/src/v1beta1/content.gen.ts index 7d4341b2a..686935e79 100644 --- a/packages_generated/interlink/src/v1beta1/content.gen.ts +++ b/packages_generated/interlink/src/v1beta1/content.gen.ts @@ -1,18 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - DedicatedConnectionStatus, - LinkStatus, -} from './types.gen.js' - +import type { DedicatedConnectionStatus, LinkStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link DedicatedConnectionStatus}. */ -export const DEDICATED_CONNECTION_TRANSIENT_STATUSES: DedicatedConnectionStatus[] = [ - 'configuring', -] +export const DEDICATED_CONNECTION_TRANSIENT_STATUSES: DedicatedConnectionStatus[] = + ['configuring'] /** Lists transient statutes of the enum {@link LinkStatus}. */ -export const LINK_TRANSIENT_STATUSES: LinkStatus[] = [ - 'configuring', -] - +export const LINK_TRANSIENT_STATUSES: LinkStatus[] = ['configuring'] diff --git a/packages_generated/interlink/src/v1beta1/index.gen.ts b/packages_generated/interlink/src/v1beta1/index.gen.ts index 45368bad2..d2ac4e45e 100644 --- a/packages_generated/interlink/src/v1beta1/index.gen.ts +++ b/packages_generated/interlink/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/interlink/src/v1beta1/marshalling.gen.ts b/packages_generated/interlink/src/v1beta1/marshalling.gen.ts index 9b694c2b5..9a13836ff 100644 --- a/packages_generated/interlink/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/interlink/src/v1beta1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Range, @@ -39,7 +43,9 @@ const unmarshalRange = (data: unknown): Range => { } as Range } -export const unmarshalDedicatedConnection = (data: unknown): DedicatedConnection => { +export const unmarshalDedicatedConnection = ( + data: unknown, +): DedicatedConnection => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DedicatedConnection' failed as data isn't a dictionary.`, @@ -121,14 +127,18 @@ export const unmarshalLink = (data: unknown): Link => { name: data.name, organizationId: data.organization_id, partner: data.partner ? unmarshalPartnerHost(data.partner) : undefined, - peerBgpConfig: data.peer_bgp_config ? unmarshalBgpConfig(data.peer_bgp_config) : undefined, + peerBgpConfig: data.peer_bgp_config + ? unmarshalBgpConfig(data.peer_bgp_config) + : undefined, popId: data.pop_id, projectId: data.project_id, region: data.region, routingPolicyId: data.routing_policy_id, routingPolicyV4Id: data.routing_policy_v4_id, routingPolicyV6Id: data.routing_policy_v6_id, - scwBgpConfig: data.scw_bgp_config ? unmarshalBgpConfig(data.scw_bgp_config) : undefined, + scwBgpConfig: data.scw_bgp_config + ? unmarshalBgpConfig(data.scw_bgp_config) + : undefined, self: data.self ? unmarshalSelfHost(data.self) : undefined, status: data.status, tags: data.tags, @@ -198,7 +208,9 @@ export const unmarshalRoutingPolicy = (data: unknown): RoutingPolicy => { } as RoutingPolicy } -export const unmarshalListDedicatedConnectionsResponse = (data: unknown): ListDedicatedConnectionsResponse => { +export const unmarshalListDedicatedConnectionsResponse = ( + data: unknown, +): ListDedicatedConnectionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDedicatedConnectionsResponse' failed as data isn't a dictionary.`, @@ -206,12 +218,17 @@ export const unmarshalListDedicatedConnectionsResponse = (data: unknown): ListDe } return { - connections: unmarshalArrayOfObject(data.connections, unmarshalDedicatedConnection), + connections: unmarshalArrayOfObject( + data.connections, + unmarshalDedicatedConnection, + ), totalCount: data.total_count, } as ListDedicatedConnectionsResponse } -export const unmarshalListLinksResponse = (data: unknown): ListLinksResponse => { +export const unmarshalListLinksResponse = ( + data: unknown, +): ListLinksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListLinksResponse' failed as data isn't a dictionary.`, @@ -224,7 +241,9 @@ export const unmarshalListLinksResponse = (data: unknown): ListLinksResponse => } as ListLinksResponse } -export const unmarshalListPartnersResponse = (data: unknown): ListPartnersResponse => { +export const unmarshalListPartnersResponse = ( + data: unknown, +): ListPartnersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPartnersResponse' failed as data isn't a dictionary.`, @@ -250,7 +269,9 @@ export const unmarshalListPopsResponse = (data: unknown): ListPopsResponse => { } as ListPopsResponse } -export const unmarshalListRoutingPoliciesResponse = (data: unknown): ListRoutingPoliciesResponse => { +export const unmarshalListRoutingPoliciesResponse = ( + data: unknown, +): ListRoutingPoliciesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`, @@ -258,7 +279,10 @@ export const unmarshalListRoutingPoliciesResponse = (data: unknown): ListRouting } return { - routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy), + routingPolicies: unmarshalArrayOfObject( + data.routing_policies, + unmarshalRoutingPolicy, + ), totalCount: data.total_count, } as ListRoutingPoliciesResponse } @@ -289,14 +313,10 @@ export const marshalCreateLinkRequest = ( routing_policy_v4_id: request.routingPolicyV4Id, routing_policy_v6_id: request.routingPolicyV6Id, tags: request.tags, - vlan: request.vlan, + vlan: request.vlan, ...resolveOneOf([ - {param: 'connection_id', - value: request.connectionId, - }, - {param: 'partner_id', - value: request.partnerId, - }, + { param: 'connection_id', value: request.connectionId }, + { param: 'partner_id', value: request.partnerId }, ]), }) diff --git a/packages_generated/interlink/src/v1beta1/types.gen.ts b/packages_generated/interlink/src/v1beta1/types.gen.ts index 6772fd1e2..1e19f1200 100644 --- a/packages_generated/interlink/src/v1beta1/types.gen.ts +++ b/packages_generated/interlink/src/v1beta1/types.gen.ts @@ -1,13 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' +import type { Region as ScwRegion } from '@scaleway/sdk-client' - -export type BgpStatus = - | 'unknown_bgp_status' - | 'up' - | 'down' - | 'disabled' +export type BgpStatus = 'unknown_bgp_status' | 'up' | 'down' | 'disabled' export type DedicatedConnectionStatus = | 'unknown_status' @@ -19,9 +14,7 @@ export type DedicatedConnectionStatus = | 'deleted' | 'locked' -export type LinkKind = - | 'hosted' - | 'self_hosted' +export type LinkKind = 'hosted' | 'self_hosted' export type LinkStatus = | 'unknown_link_status' @@ -57,13 +50,9 @@ export type ListLinksRequestOrderBy = | 'status_asc' | 'status_desc' -export type ListPartnersRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListPartnersRequestOrderBy = 'name_asc' | 'name_desc' -export type ListPopsRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListPopsRequestOrderBy = 'name_asc' | 'name_desc' export type ListRoutingPoliciesRequestOrderBy = | 'created_at_asc' @@ -86,13 +75,11 @@ export interface BgpConfig { ipv6: string } - export interface Range { start: number end: number } - export interface PartnerHost { /** * ID of the partner facilitating the link. @@ -108,7 +95,6 @@ export interface PartnerHost { disapprovedReason?: string } - export interface SelfHost { /** * Dedicated physical connection supporting the link. @@ -116,7 +102,6 @@ export interface SelfHost { connectionId: string } - export interface DedicatedConnection { /** * Unique identifier of the dedicated connection. @@ -176,7 +161,6 @@ export interface DedicatedConnection { region: ScwRegion } - export interface Link { /** * Unique identifier of the link. @@ -276,7 +260,6 @@ export interface Link { region: ScwRegion } - export interface Partner { /** * Unique identifier of the partner. @@ -308,7 +291,6 @@ export interface Partner { updatedAt?: Date } - export interface Pop { /** * Unique identifier of the PoP. @@ -348,7 +330,6 @@ export interface Pop { region: ScwRegion } - export interface RoutingPolicy { /** * Unique identifier of the routing policy. @@ -396,7 +377,6 @@ export interface RoutingPolicy { region: ScwRegion } - export type AttachRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -412,7 +392,6 @@ export type AttachRoutingPolicyRequest = { routingPolicyId: string } - export type AttachVpcRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -428,7 +407,6 @@ export type AttachVpcRequest = { vpcId: string } - export type CreateLinkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -484,7 +462,6 @@ export type CreateLinkRequest = { routingPolicyV6Id?: string } - export type CreateRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -516,7 +493,6 @@ export type CreateRoutingPolicyRequest = { isIpv6: boolean } - export type DeleteLinkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -528,7 +504,6 @@ export type DeleteLinkRequest = { linkId: string } - export type DeleteRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -540,7 +515,6 @@ export type DeleteRoutingPolicyRequest = { routingPolicyId: string } - export type DetachRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -556,7 +530,6 @@ export type DetachRoutingPolicyRequest = { routingPolicyId: string } - export type DetachVpcRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -568,7 +541,6 @@ export type DetachVpcRequest = { linkId: string } - export type DisableRoutePropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -580,7 +552,6 @@ export type DisableRoutePropagationRequest = { linkId: string } - export type EnableRoutePropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -592,7 +563,6 @@ export type EnableRoutePropagationRequest = { linkId: string } - export type GetDedicatedConnectionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -604,7 +574,6 @@ export type GetDedicatedConnectionRequest = { connectionId: string } - export type GetLinkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -616,7 +585,6 @@ export type GetLinkRequest = { linkId: string } - export type GetPartnerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -628,7 +596,6 @@ export type GetPartnerRequest = { partnerId: string } - export type GetPopRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -640,7 +607,6 @@ export type GetPopRequest = { popId: string } - export type GetRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -652,7 +618,6 @@ export type GetRoutingPolicyRequest = { routingPolicyId: string } - export type ListDedicatedConnectionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -700,7 +665,6 @@ export type ListDedicatedConnectionsRequest = { popId?: string } - export interface ListDedicatedConnectionsResponse { /** * List of connections on current page. @@ -712,7 +676,6 @@ export interface ListDedicatedConnectionsResponse { totalCount: number } - export type ListLinksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -792,7 +755,6 @@ export type ListLinksRequest = { connectionId?: string } - export interface ListLinksResponse { /** * List of links on the current page. @@ -804,7 +766,6 @@ export interface ListLinksResponse { totalCount: number } - export type ListPartnersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -828,7 +789,6 @@ export type ListPartnersRequest = { popIds?: string[] } - export interface ListPartnersResponse { /** * List of partners on current page. @@ -840,7 +800,6 @@ export interface ListPartnersResponse { totalCount: number } - export type ListPopsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -880,7 +839,6 @@ export type ListPopsRequest = { dedicatedAvailable?: boolean } - export interface ListPopsResponse { /** * List of PoPs on the current page. @@ -892,7 +850,6 @@ export interface ListPopsResponse { totalCount: number } - export type ListRoutingPoliciesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -932,13 +889,11 @@ export type ListRoutingPoliciesRequest = { ipv6?: boolean } - export interface ListRoutingPoliciesResponse { routingPolicies: RoutingPolicy[] totalCount: number } - export type SetRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -954,7 +909,6 @@ export type SetRoutingPolicyRequest = { routingPolicyId: string } - export type UpdateLinkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -978,7 +932,6 @@ export type UpdateLinkRequest = { peerAsn?: number } - export type UpdateRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1005,5 +958,3 @@ export type UpdateRoutingPolicyRequest = { */ prefixFilterOut?: string[] } - - diff --git a/packages_generated/iot/src/v1/api.gen.ts b/packages_generated/iot/src/v1/api.gen.ts index 29214668a..050997d76 100644 --- a/packages_generated/iot/src/v1/api.gen.ts +++ b/packages_generated/iot/src/v1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {HUB_TRANSIENT_STATUSES as HUB_TRANSIENT_STATUSES_IOT,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { HUB_TRANSIENT_STATUSES as HUB_TRANSIENT_STATUSES_IOT } from './content.gen.js' import { marshalCreateDeviceRequest, unmarshalCreateDeviceResponse, @@ -112,13 +112,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + protected pageOfListHubs = (request: Readonly = {}) => this.client.fetch( { @@ -129,13 +126,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListHubsResponse, ) - + /** * List hubs. List all Hubs in the specified zone. By default, returned Hubs are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -145,7 +145,6 @@ export class API extends ParentAPI { listHubs = (request: Readonly = {}) => enrichForPagination('hubs', this.pageOfListHubs, request) - /** * Create a hub. Create a new Hub in the targeted region, specifying its configuration including name and product plan. * @@ -165,7 +164,6 @@ export class API extends ParentAPI { unmarshalHub, ) - /** * Get a hub. Retrieve information about an existing IoT Hub, specified by its Hub ID. Its full details, including name, status and endpoint, are returned in the response object. * @@ -180,7 +178,7 @@ export class API extends ParentAPI { }, unmarshalHub, ) - + /** * Waits for {@link Hub} to be in a final state. * @@ -193,13 +191,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!HUB_TRANSIENT_STATUSES_IOT.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!HUB_TRANSIENT_STATUSES_IOT.includes(res.status))), this.getHub, request, options, ) - /** * Update a hub. Update the parameters of an existing IoT Hub, specified by its Hub ID. * @@ -219,7 +218,6 @@ export class API extends ParentAPI { unmarshalHub, ) - /** * Enable a hub. Enable an existing IoT Hub, specified by its Hub ID. * @@ -237,7 +235,6 @@ export class API extends ParentAPI { unmarshalHub, ) - /** * Disable a hub. Disable an existing IoT Hub, specified by its Hub ID. * @@ -255,24 +252,18 @@ export class API extends ParentAPI { unmarshalHub, ) - /** * Delete a hub. Delete an existing IoT Hub, specified by its Hub ID. Deleting a Hub is permanent, and cannot be undone. * * @param request - The request {@link DeleteHubRequest} */ deleteHub = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`, - urlParams: urlParams( - ['delete_devices', request.deleteDevices], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}`, + urlParams: urlParams(['delete_devices', request.deleteDevices]), + }) - /** * Get a hub's metrics. Get the metrics of an existing IoT Hub, specified by its Hub ID. * @@ -285,14 +276,11 @@ export class API extends ParentAPI { { method: 'GET', path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hubs/${validatePathParam('hubId', request.hubId)}/metrics`, - urlParams: urlParams( - ['start_date', request.startDate], - ), + urlParams: urlParams(['start_date', request.startDate]), }, unmarshalGetHubMetricsResponse, ) - /** * Set the certificate authority of a hub. Set a particular PEM-encoded certificate, specified by the Hub ID. * @@ -312,7 +300,6 @@ export class API extends ParentAPI { unmarshalHub, ) - /** * Get the certificate authority of a hub. Get information for a particular PEM-encoded certificate, specified by the Hub ID. * @@ -328,7 +315,6 @@ export class API extends ParentAPI { unmarshalGetHubCAResponse, ) - protected pageOfListDevices = (request: Readonly = {}) => this.client.fetch( { @@ -340,13 +326,16 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['status', request.status], ), }, unmarshalListDevicesResponse, ) - + /** * List devices. List all devices in the specified region. By default, returned devices are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -356,7 +345,6 @@ export class API extends ParentAPI { listDevices = (request: Readonly = {}) => enrichForPagination('devices', this.pageOfListDevices, request) - /** * Add a device. Attach a device to a given Hub. * @@ -376,7 +364,6 @@ export class API extends ParentAPI { unmarshalCreateDeviceResponse, ) - /** * Get a device. Retrieve information about an existing device, specified by its device ID. Its full details, including name, status and ID, are returned in the response object. * @@ -392,7 +379,6 @@ export class API extends ParentAPI { unmarshalDevice, ) - /** * Update a device. Update the parameters of an existing device, specified by its device ID. * @@ -412,7 +398,6 @@ export class API extends ParentAPI { unmarshalDevice, ) - /** * Enable a device. Enable a specific device, specified by its device ID. * @@ -430,7 +415,6 @@ export class API extends ParentAPI { unmarshalDevice, ) - /** * Disable a device. Disable an existing device, specified by its device ID. * @@ -448,7 +432,6 @@ export class API extends ParentAPI { unmarshalDevice, ) - /** * Renew a device certificate. Renew the certificate of an existing device, specified by its device ID. * @@ -466,7 +449,6 @@ export class API extends ParentAPI { unmarshalRenewDeviceCertificateResponse, ) - /** * Set a custom certificate on a device. Switch the existing certificate of a given device with an EM-encoded custom certificate. * @@ -486,7 +468,6 @@ export class API extends ParentAPI { unmarshalSetDeviceCertificateResponse, ) - /** * Get a device's certificate. Get information for a particular PEM-encoded certificate, specified by the device ID. The response returns full details of the device, including its type of certificate. * @@ -502,21 +483,17 @@ export class API extends ParentAPI { unmarshalGetDeviceCertificateResponse, ) - /** * Remove a device. Remove a specific device from the specific Hub it is attached to. * * @param request - The request {@link DeleteDeviceRequest} */ deleteDevice = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}`, + }) - /** * Get a device's metrics. Get the metrics of an existing device, specified by its device ID. * @@ -529,14 +506,11 @@ export class API extends ParentAPI { { method: 'GET', path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/devices/${validatePathParam('deviceId', request.deviceId)}/metrics`, - urlParams: urlParams( - ['start_date', request.startDate], - ), + urlParams: urlParams(['start_date', request.startDate]), }, unmarshalGetDeviceMetricsResponse, ) - protected pageOfListRoutes = (request: Readonly = {}) => this.client.fetch( { @@ -547,12 +521,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListRoutesResponse, ) - + /** * List routes. List all routes in the specified region. By default, returned routes are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -562,7 +539,6 @@ export class API extends ParentAPI { listRoutes = (request: Readonly = {}) => enrichForPagination('routes', this.pageOfListRoutes, request) - /** * Create a route. Multiple kinds of routes can be created, such as: - Database Route @@ -591,7 +567,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Update a route. Update the parameters of an existing route, specified by its route ID. * @@ -611,7 +586,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Get a route. Get information for a particular route, specified by the route ID. The response returns full details of the route, including its type, the topic it subscribes to and its configuration. * @@ -627,22 +601,20 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone. * * @param request - The request {@link DeleteRouteRequest} */ deleteRoute = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, + }) - - protected pageOfListNetworks = (request: Readonly = {}) => + protected pageOfListNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -652,13 +624,16 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['topic_prefix', request.topicPrefix], ), }, unmarshalListNetworksResponse, ) - + /** * List the networks. * @@ -668,7 +643,6 @@ export class API extends ParentAPI { listNetworks = (request: Readonly = {}) => enrichForPagination('networks', this.pageOfListNetworks, request) - /** * Create a new network. Create a new network for an existing hub. Beside the default network, you can add networks for different data providers. Possible network types are Sigfox and REST. * @@ -688,7 +662,6 @@ export class API extends ParentAPI { unmarshalCreateNetworkResponse, ) - /** * Retrieve a specific network. Retrieve an existing network, specified by its network ID. The response returns full details of the network, including its type, the topic prefix and its endpoint. * @@ -704,21 +677,17 @@ export class API extends ParentAPI { unmarshalNetwork, ) - /** * Delete a Network. Delete an existing network, specified by its network ID. Deleting a network is permanent, and cannot be undone. * * @param request - The request {@link DeleteNetworkRequest} */ deleteNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/networks/${validatePathParam('networkId', request.networkId)}`, + }) - /** * BETA - Get a Cloud Twin Document. * @@ -734,7 +703,6 @@ export class API extends ParentAPI { unmarshalTwinDocument, ) - /** * BETA - Update a Cloud Twin Document. * @@ -754,7 +722,6 @@ export class API extends ParentAPI { unmarshalTwinDocument, ) - /** * BETA - Patch a Cloud Twin Document. * @@ -774,21 +741,17 @@ export class API extends ParentAPI { unmarshalTwinDocument, ) - /** * BETA - Delete a Cloud Twin Document. * * @param request - The request {@link DeleteTwinDocumentRequest} */ deleteTwinDocument = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}/documents/${validatePathParam('documentName', request.documentName)}`, + }) - /** * BETA - List the documents of a Cloud Twin. * @@ -804,20 +767,14 @@ export class API extends ParentAPI { unmarshalListTwinDocumentsResponse, ) - /** * BETA - Delete all the documents of a Cloud Twin. * * @param request - The request {@link DeleteTwinDocumentsRequest} */ deleteTwinDocuments = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/iot/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/twins/${validatePathParam('twinId', request.twinId)}`, + }) } - diff --git a/packages_generated/iot/src/v1/content.gen.ts b/packages_generated/iot/src/v1/content.gen.ts index f3f89336b..79a84cde8 100644 --- a/packages_generated/iot/src/v1/content.gen.ts +++ b/packages_generated/iot/src/v1/content.gen.ts @@ -1,13 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - HubStatus, -} from './types.gen.js' - +import type { HubStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link HubStatus}. */ -export const HUB_TRANSIENT_STATUSES: HubStatus[] = [ - 'enabling', - 'disabling', -] - +export const HUB_TRANSIENT_STATUSES: HubStatus[] = ['enabling', 'disabling'] diff --git a/packages_generated/iot/src/v1/index.gen.ts b/packages_generated/iot/src/v1/index.gen.ts index 460e335ad..4fcbd71c0 100644 --- a/packages_generated/iot/src/v1/index.gen.ts +++ b/packages_generated/iot/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/iot/src/v1/marshalling.gen.ts b/packages_generated/iot/src/v1/marshalling.gen.ts index 155e4a1e3..af91bc8a8 100644 --- a/packages_generated/iot/src/v1/marshalling.gen.ts +++ b/packages_generated/iot/src/v1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalTimeSeries, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { DeviceMessageFiltersRule, @@ -50,7 +56,9 @@ import type { UpdateRouteRequest, } from './types.gen.js' -const unmarshalDeviceMessageFiltersRule = (data: unknown): DeviceMessageFiltersRule => { +const unmarshalDeviceMessageFiltersRule = ( + data: unknown, +): DeviceMessageFiltersRule => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeviceMessageFiltersRule' failed as data isn't a dictionary.`, @@ -71,8 +79,12 @@ const unmarshalDeviceMessageFilters = (data: unknown): DeviceMessageFilters => { } return { - publish: data.publish ? unmarshalDeviceMessageFiltersRule(data.publish) : undefined, - subscribe: data.subscribe ? unmarshalDeviceMessageFiltersRule(data.subscribe) : undefined, + publish: data.publish + ? unmarshalDeviceMessageFiltersRule(data.publish) + : undefined, + subscribe: data.subscribe + ? unmarshalDeviceMessageFiltersRule(data.subscribe) + : undefined, } as DeviceMessageFilters } @@ -93,7 +105,9 @@ export const unmarshalDevice = (data: unknown): Device => { id: data.id, isConnected: data.is_connected, lastActivityAt: unmarshalDate(data.last_activity_at), - messageFilters: data.message_filters ? unmarshalDeviceMessageFilters(data.message_filters) : undefined, + messageFilters: data.message_filters + ? unmarshalDeviceMessageFilters(data.message_filters) + : undefined, name: data.name, region: data.region, status: data.status, @@ -120,7 +134,9 @@ export const unmarshalNetwork = (data: unknown): Network => { } as Network } -const unmarshalHubTwinsGraphiteConfig = (data: unknown): HubTwinsGraphiteConfig => { +const unmarshalHubTwinsGraphiteConfig = ( + data: unknown, +): HubTwinsGraphiteConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HubTwinsGraphiteConfig' failed as data isn't a dictionary.`, @@ -156,7 +172,9 @@ export const unmarshalHub = (data: unknown): Hub => { projectId: data.project_id, region: data.region, status: data.status, - twinsGraphiteConfig: data.twins_graphite_config ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) : undefined, + twinsGraphiteConfig: data.twins_graphite_config + ? unmarshalHubTwinsGraphiteConfig(data.twins_graphite_config) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as Hub } @@ -174,7 +192,9 @@ const unmarshalCertificate = (data: unknown): Certificate => { } as Certificate } -export const unmarshalCreateDeviceResponse = (data: unknown): CreateDeviceResponse => { +export const unmarshalCreateDeviceResponse = ( + data: unknown, +): CreateDeviceResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateDeviceResponse' failed as data isn't a dictionary.`, @@ -182,12 +202,16 @@ export const unmarshalCreateDeviceResponse = (data: unknown): CreateDeviceRespon } return { - certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined, + certificate: data.certificate + ? unmarshalCertificate(data.certificate) + : undefined, device: data.device ? unmarshalDevice(data.device) : undefined, } as CreateDeviceResponse } -export const unmarshalCreateNetworkResponse = (data: unknown): CreateNetworkResponse => { +export const unmarshalCreateNetworkResponse = ( + data: unknown, +): CreateNetworkResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateNetworkResponse' failed as data isn't a dictionary.`, @@ -200,7 +224,9 @@ export const unmarshalCreateNetworkResponse = (data: unknown): CreateNetworkResp } as CreateNetworkResponse } -export const unmarshalGetDeviceCertificateResponse = (data: unknown): GetDeviceCertificateResponse => { +export const unmarshalGetDeviceCertificateResponse = ( + data: unknown, +): GetDeviceCertificateResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDeviceCertificateResponse' failed as data isn't a dictionary.`, @@ -213,7 +239,9 @@ export const unmarshalGetDeviceCertificateResponse = (data: unknown): GetDeviceC } as GetDeviceCertificateResponse } -export const unmarshalGetDeviceMetricsResponse = (data: unknown): GetDeviceMetricsResponse => { +export const unmarshalGetDeviceMetricsResponse = ( + data: unknown, +): GetDeviceMetricsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetDeviceMetricsResponse' failed as data isn't a dictionary.`, @@ -237,7 +265,9 @@ export const unmarshalGetHubCAResponse = (data: unknown): GetHubCAResponse => { } as GetHubCAResponse } -export const unmarshalGetHubMetricsResponse = (data: unknown): GetHubMetricsResponse => { +export const unmarshalGetHubMetricsResponse = ( + data: unknown, +): GetHubMetricsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'GetHubMetricsResponse' failed as data isn't a dictionary.`, @@ -249,7 +279,9 @@ export const unmarshalGetHubMetricsResponse = (data: unknown): GetHubMetricsResp } as GetHubMetricsResponse } -export const unmarshalListDevicesResponse = (data: unknown): ListDevicesResponse => { +export const unmarshalListDevicesResponse = ( + data: unknown, +): ListDevicesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDevicesResponse' failed as data isn't a dictionary.`, @@ -275,7 +307,9 @@ export const unmarshalListHubsResponse = (data: unknown): ListHubsResponse => { } as ListHubsResponse } -export const unmarshalListNetworksResponse = (data: unknown): ListNetworksResponse => { +export const unmarshalListNetworksResponse = ( + data: unknown, +): ListNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNetworksResponse' failed as data isn't a dictionary.`, @@ -307,7 +341,9 @@ const unmarshalRouteSummary = (data: unknown): RouteSummary => { } as RouteSummary } -export const unmarshalListRoutesResponse = (data: unknown): ListRoutesResponse => { +export const unmarshalListRoutesResponse = ( + data: unknown, +): ListRoutesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`, @@ -320,7 +356,9 @@ export const unmarshalListRoutesResponse = (data: unknown): ListRoutesResponse = } as ListRoutesResponse } -const unmarshalListTwinDocumentsResponseDocumentSummary = (data: unknown): ListTwinDocumentsResponseDocumentSummary => { +const unmarshalListTwinDocumentsResponseDocumentSummary = ( + data: unknown, +): ListTwinDocumentsResponseDocumentSummary => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTwinDocumentsResponseDocumentSummary' failed as data isn't a dictionary.`, @@ -332,7 +370,9 @@ const unmarshalListTwinDocumentsResponseDocumentSummary = (data: unknown): ListT } as ListTwinDocumentsResponseDocumentSummary } -export const unmarshalListTwinDocumentsResponse = (data: unknown): ListTwinDocumentsResponse => { +export const unmarshalListTwinDocumentsResponse = ( + data: unknown, +): ListTwinDocumentsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListTwinDocumentsResponse' failed as data isn't a dictionary.`, @@ -340,11 +380,16 @@ export const unmarshalListTwinDocumentsResponse = (data: unknown): ListTwinDocum } return { - documents: unmarshalArrayOfObject(data.documents, unmarshalListTwinDocumentsResponseDocumentSummary), + documents: unmarshalArrayOfObject( + data.documents, + unmarshalListTwinDocumentsResponseDocumentSummary, + ), } as ListTwinDocumentsResponse } -export const unmarshalRenewDeviceCertificateResponse = (data: unknown): RenewDeviceCertificateResponse => { +export const unmarshalRenewDeviceCertificateResponse = ( + data: unknown, +): RenewDeviceCertificateResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RenewDeviceCertificateResponse' failed as data isn't a dictionary.`, @@ -352,7 +397,9 @@ export const unmarshalRenewDeviceCertificateResponse = (data: unknown): RenewDev } return { - certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined, + certificate: data.certificate + ? unmarshalCertificate(data.certificate) + : undefined, device: data.device ? unmarshalDevice(data.device) : undefined, } as RenewDeviceCertificateResponse } @@ -413,20 +460,28 @@ export const unmarshalRoute = (data: unknown): Route => { return { createdAt: unmarshalDate(data.created_at), - dbConfig: data.db_config ? unmarshalRouteDatabaseConfig(data.db_config) : undefined, + dbConfig: data.db_config + ? unmarshalRouteDatabaseConfig(data.db_config) + : undefined, hubId: data.hub_id, id: data.id, name: data.name, region: data.region, - restConfig: data.rest_config ? unmarshalRouteRestConfig(data.rest_config) : undefined, - s3Config: data.s3_config ? unmarshalRouteS3Config(data.s3_config) : undefined, + restConfig: data.rest_config + ? unmarshalRouteRestConfig(data.rest_config) + : undefined, + s3Config: data.s3_config + ? unmarshalRouteS3Config(data.s3_config) + : undefined, topic: data.topic, type: data.type, updatedAt: unmarshalDate(data.updated_at), } as Route } -export const unmarshalSetDeviceCertificateResponse = (data: unknown): SetDeviceCertificateResponse => { +export const unmarshalSetDeviceCertificateResponse = ( + data: unknown, +): SetDeviceCertificateResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetDeviceCertificateResponse' failed as data isn't a dictionary.`, @@ -466,8 +521,14 @@ const marshalDeviceMessageFilters = ( request: DeviceMessageFilters, defaults: DefaultValues, ): Record => ({ - publish: ((request.publish !== undefined) ? marshalDeviceMessageFiltersRule(request.publish, defaults): undefined), - subscribe: ((request.subscribe !== undefined) ? marshalDeviceMessageFiltersRule(request.subscribe, defaults): undefined), + publish: + request.publish !== undefined + ? marshalDeviceMessageFiltersRule(request.publish, defaults) + : undefined, + subscribe: + request.subscribe !== undefined + ? marshalDeviceMessageFiltersRule(request.subscribe, defaults) + : undefined, }) export const marshalCreateDeviceRequest = ( @@ -478,7 +539,10 @@ export const marshalCreateDeviceRequest = ( allow_multiple_connections: request.allowMultipleConnections, description: request.description, hub_id: request.hubId, - message_filters: ((request.messageFilters !== undefined) ? marshalDeviceMessageFilters(request.messageFilters, defaults): undefined), + message_filters: + request.messageFilters !== undefined + ? marshalDeviceMessageFilters(request.messageFilters, defaults) + : undefined, name: request.name || randomName('device'), }) @@ -497,11 +561,14 @@ export const marshalCreateHubRequest = ( events_topic_prefix: request.eventsTopicPrefix, name: request.name || randomName('hub'), product_plan: request.productPlan, - project_id: request.projectId ?? defaults.defaultProjectId, + project_id: request.projectId ?? defaults.defaultProjectId, ...resolveOneOf([ - {param: 'twins_graphite_config', - value: (request.twinsGraphiteConfig !== undefined) ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig, defaults) - : undefined, + { + param: 'twins_graphite_config', + value: + request.twinsGraphiteConfig !== undefined + ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig, defaults) + : undefined, }, ]), }) @@ -533,7 +600,7 @@ const marshalCreateRouteRequestRestConfig = ( request: CreateRouteRequestRestConfig, defaults: DefaultValues, ): Record => ({ - headers: request.headers, + headers: request.headers, uri: request.uri, verb: request.verb, }) @@ -554,19 +621,28 @@ export const marshalCreateRouteRequest = ( ): Record => ({ hub_id: request.hubId, name: request.name || randomName('route'), - topic: request.topic, + topic: request.topic, ...resolveOneOf([ - {param: 's3_config', - value: (request.s3Config !== undefined) ? marshalCreateRouteRequestS3Config(request.s3Config, defaults) - : undefined, + { + param: 's3_config', + value: + request.s3Config !== undefined + ? marshalCreateRouteRequestS3Config(request.s3Config, defaults) + : undefined, }, - {param: 'db_config', - value: (request.dbConfig !== undefined) ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig, defaults) - : undefined, + { + param: 'db_config', + value: + request.dbConfig !== undefined + ? marshalCreateRouteRequestDatabaseConfig(request.dbConfig, defaults) + : undefined, }, - {param: 'rest_config', - value: (request.restConfig !== undefined) ? marshalCreateRouteRequestRestConfig(request.restConfig, defaults) - : undefined, + { + param: 'rest_config', + value: + request.restConfig !== undefined + ? marshalCreateRouteRequestRestConfig(request.restConfig, defaults) + : undefined, }, ]), }) @@ -610,7 +686,10 @@ export const marshalUpdateDeviceRequest = ( allow_multiple_connections: request.allowMultipleConnections, description: request.description, hub_id: request.hubId, - message_filters: ((request.messageFilters !== undefined) ? marshalDeviceMessageFilters(request.messageFilters, defaults): undefined), + message_filters: + request.messageFilters !== undefined + ? marshalDeviceMessageFilters(request.messageFilters, defaults) + : undefined, }) export const marshalUpdateHubRequest = ( @@ -621,11 +700,14 @@ export const marshalUpdateHubRequest = ( enable_device_auto_provisioning: request.enableDeviceAutoProvisioning, events_topic_prefix: request.eventsTopicPrefix, name: request.name, - product_plan: request.productPlan, + product_plan: request.productPlan, ...resolveOneOf([ - {param: 'twins_graphite_config', - value: (request.twinsGraphiteConfig !== undefined) ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig, defaults) - : undefined, + { + param: 'twins_graphite_config', + value: + request.twinsGraphiteConfig !== undefined + ? marshalHubTwinsGraphiteConfig(request.twinsGraphiteConfig, defaults) + : undefined, }, ]), }) @@ -667,19 +749,28 @@ export const marshalUpdateRouteRequest = ( defaults: DefaultValues, ): Record => ({ name: request.name, - topic: request.topic, + topic: request.topic, ...resolveOneOf([ - {param: 's3_config', - value: (request.s3Config !== undefined) ? marshalUpdateRouteRequestS3Config(request.s3Config, defaults) - : undefined, + { + param: 's3_config', + value: + request.s3Config !== undefined + ? marshalUpdateRouteRequestS3Config(request.s3Config, defaults) + : undefined, }, - {param: 'db_config', - value: (request.dbConfig !== undefined) ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig, defaults) - : undefined, + { + param: 'db_config', + value: + request.dbConfig !== undefined + ? marshalUpdateRouteRequestDatabaseConfig(request.dbConfig, defaults) + : undefined, }, - {param: 'rest_config', - value: (request.restConfig !== undefined) ? marshalUpdateRouteRequestRestConfig(request.restConfig, defaults) - : undefined, + { + param: 'rest_config', + value: + request.restConfig !== undefined + ? marshalUpdateRouteRequestRestConfig(request.restConfig, defaults) + : undefined, }, ]), }) diff --git a/packages_generated/iot/src/v1/types.gen.ts b/packages_generated/iot/src/v1/types.gen.ts index dcbc66f87..33607c318 100644 --- a/packages_generated/iot/src/v1/types.gen.ts +++ b/packages_generated/iot/src/v1/types.gen.ts @@ -1,18 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, TimeSeries, } from '@scaleway/sdk-client' +import type { Region as ScwRegion, TimeSeries } from '@scaleway/sdk-client' +export type DeviceMessageFiltersRulePolicy = 'unknown' | 'accept' | 'reject' -export type DeviceMessageFiltersRulePolicy = - | 'unknown' - | 'accept' - | 'reject' - -export type DeviceStatus = - | 'unknown' - | 'error' - | 'enabled' - | 'disabled' +export type DeviceStatus = 'unknown' | 'error' | 'enabled' | 'disabled' export type HubProductPlan = | 'plan_unknown' @@ -72,15 +64,9 @@ export type ListRoutesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type NetworkNetworkType = - | 'unknown' - | 'sigfox' - | 'rest' +export type NetworkNetworkType = 'unknown' | 'sigfox' | 'rest' -export type RouteDatabaseConfigEngine = - | 'unknown' - | 'postgresql' - | 'mysql' +export type RouteDatabaseConfigEngine = 'unknown' | 'postgresql' | 'mysql' export type RouteRestConfigHttpVerb = | 'unknown' @@ -90,16 +76,9 @@ export type RouteRestConfigHttpVerb = | 'patch' | 'delete' -export type RouteRouteType = - | 'unknown' - | 's3' - | 'database' - | 'rest' +export type RouteRouteType = 'unknown' | 's3' | 'database' | 'rest' -export type RouteS3ConfigS3Strategy = - | 'unknown' - | 'per_topic' - | 'per_message' +export type RouteS3ConfigS3Strategy = 'unknown' | 'per_topic' | 'per_message' export interface DeviceMessageFiltersRule { /** @@ -113,7 +92,6 @@ If set to `reject`, all topics in the topics list will be denied, with all other topics?: string[] } - export interface DeviceMessageFilters { /** * Filtering rule to restrict topics the device can publish to. @@ -125,18 +103,15 @@ export interface DeviceMessageFilters { subscribe?: DeviceMessageFiltersRule } - export interface HubTwinsGraphiteConfig { pushUri: string } - export interface Certificate { crt: string key: string } - export interface Device { /** * Device ID, also used as MQTT Client ID or username. @@ -196,7 +171,6 @@ export interface Device { region: ScwRegion } - export interface Network { /** * Network ID. @@ -232,7 +206,6 @@ export interface Network { region: ScwRegion } - export interface CreateRouteRequestDatabaseConfig { host: string port: number @@ -243,14 +216,12 @@ export interface CreateRouteRequestDatabaseConfig { engine: RouteDatabaseConfigEngine } - export interface CreateRouteRequestRestConfig { verb: RouteRestConfigHttpVerb uri: string headers: Record } - export interface CreateRouteRequestS3Config { bucketRegion: string bucketName: string @@ -258,7 +229,6 @@ export interface CreateRouteRequestS3Config { strategy: RouteS3ConfigS3Strategy } - export interface Hub { /** * Hub ID. @@ -336,7 +306,6 @@ export interface Hub { twinsGraphiteConfig?: HubTwinsGraphiteConfig } - export interface RouteSummary { /** * Route ID. @@ -372,7 +341,6 @@ export interface RouteSummary { region: ScwRegion } - export interface ListTwinDocumentsResponseDocumentSummary { /** * Name of the document. @@ -380,7 +348,6 @@ export interface ListTwinDocumentsResponseDocumentSummary { documentName: string } - export interface RouteDatabaseConfig { /** * Database engine the route will connect to. If not specified, the default database will be 'PostgreSQL'. @@ -412,7 +379,6 @@ export interface RouteDatabaseConfig { query: string } - export interface RouteRestConfig { /** * HTTP verb used to call REST URI. @@ -428,7 +394,6 @@ export interface RouteRestConfig { headers: Record } - export interface RouteS3Config { /** * Region of the Amazon S3 route's destination bucket (e.g., 'fr-par'). @@ -448,7 +413,6 @@ export interface RouteS3Config { strategy: RouteS3ConfigS3Strategy } - export interface UpdateRouteRequestDatabaseConfig { host?: string port?: number @@ -459,14 +423,12 @@ export interface UpdateRouteRequestDatabaseConfig { engine: RouteDatabaseConfigEngine } - export interface UpdateRouteRequestRestConfig { verb: RouteRestConfigHttpVerb uri?: string headers?: Record } - export interface UpdateRouteRequestS3Config { bucketRegion?: string bucketName?: string @@ -474,7 +436,6 @@ export interface UpdateRouteRequestS3Config { strategy: RouteS3ConfigS3Strategy } - export type CreateDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -506,7 +467,6 @@ export type CreateDeviceRequest = { description?: string } - export interface CreateDeviceResponse { /** * Information related to the created device. @@ -518,7 +478,6 @@ export interface CreateDeviceResponse { certificate?: Certificate } - export type CreateHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -552,7 +511,6 @@ export type CreateHubRequest = { twinsGraphiteConfig?: HubTwinsGraphiteConfig } - export type CreateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -576,7 +534,6 @@ export type CreateNetworkRequest = { topicPrefix: string } - export interface CreateNetworkResponse { /** * Information related to the created network. @@ -588,7 +545,6 @@ export interface CreateNetworkResponse { secret: string } - export type CreateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -626,7 +582,6 @@ export type CreateRouteRequest = { restConfig?: CreateRouteRequestRestConfig } - export type DeleteDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -638,7 +593,6 @@ export type DeleteDeviceRequest = { deviceId: string } - export type DeleteHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -654,7 +608,6 @@ export type DeleteHubRequest = { deleteDevices?: boolean } - export type DeleteNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -666,7 +619,6 @@ export type DeleteNetworkRequest = { networkId: string } - export type DeleteRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -678,7 +630,6 @@ export type DeleteRouteRequest = { routeId: string } - export type DeleteTwinDocumentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -694,7 +645,6 @@ export type DeleteTwinDocumentRequest = { documentName: string } - export type DeleteTwinDocumentsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -706,7 +656,6 @@ export type DeleteTwinDocumentsRequest = { twinId: string } - export type DisableDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -718,7 +667,6 @@ export type DisableDeviceRequest = { deviceId: string } - export type DisableHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -730,7 +678,6 @@ export type DisableHubRequest = { hubId: string } - export type EnableDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -742,7 +689,6 @@ export type EnableDeviceRequest = { deviceId: string } - export type EnableHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -754,7 +700,6 @@ export type EnableHubRequest = { hubId: string } - export type GetDeviceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -766,7 +711,6 @@ export type GetDeviceCertificateRequest = { deviceId: string } - export interface GetDeviceCertificateResponse { /** * Information related to the created device. @@ -778,7 +722,6 @@ export interface GetDeviceCertificateResponse { certificatePem: string } - export type GetDeviceMetricsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -794,7 +737,6 @@ export type GetDeviceMetricsRequest = { startDate?: Date } - export interface GetDeviceMetricsResponse { /** * Metrics for a device over the requested period. @@ -802,7 +744,6 @@ export interface GetDeviceMetricsResponse { metrics: TimeSeries[] } - export type GetDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -814,7 +755,6 @@ export type GetDeviceRequest = { deviceId: string } - export type GetHubCARequest = { /** * Region to target. If none is passed will use default region from the config. @@ -823,12 +763,10 @@ export type GetHubCARequest = { hubId: string } - export interface GetHubCAResponse { caCertPem: string } - export type GetHubMetricsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -844,7 +782,6 @@ export type GetHubMetricsRequest = { startDate?: Date } - export interface GetHubMetricsResponse { /** * Metrics for a Hub over the requested period. @@ -852,7 +789,6 @@ export interface GetHubMetricsResponse { metrics: TimeSeries[] } - export type GetHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -864,7 +800,6 @@ export type GetHubRequest = { hubId: string } - export type GetNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -876,7 +811,6 @@ export type GetNetworkRequest = { networkId: string } - export type GetRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -888,7 +822,6 @@ export type GetRouteRequest = { routeId: string } - export type GetTwinDocumentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -904,7 +837,6 @@ export type GetTwinDocumentRequest = { documentName: string } - export type ListDevicesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -940,7 +872,6 @@ export type ListDevicesRequest = { status?: DeviceStatus } - export interface ListDevicesResponse { /** * Total number of devices. @@ -952,7 +883,6 @@ export interface ListDevicesResponse { devices: Device[] } - export type ListHubsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -984,7 +914,6 @@ export type ListHubsRequest = { name?: string } - export interface ListHubsResponse { /** * Total number of Hubs. @@ -996,7 +925,6 @@ export interface ListHubsResponse { hubs: Hub[] } - export type ListNetworksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1028,7 +956,6 @@ export type ListNetworksRequest = { topicPrefix?: string } - export interface ListNetworksResponse { /** * Total number of Networks. @@ -1040,7 +967,6 @@ export interface ListNetworksResponse { networks: Network[] } - export type ListRoutesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1068,7 +994,6 @@ export type ListRoutesRequest = { name?: string } - export interface ListRoutesResponse { /** * Total number of routes. @@ -1080,7 +1005,6 @@ export interface ListRoutesResponse { routes: RouteSummary[] } - export type ListTwinDocumentsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1092,7 +1016,6 @@ export type ListTwinDocumentsRequest = { twinId: string } - export interface ListTwinDocumentsResponse { /** * List of the twin document. @@ -1100,7 +1023,6 @@ export interface ListTwinDocumentsResponse { documents: ListTwinDocumentsResponseDocumentSummary[] } - export type PatchTwinDocumentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1129,7 +1051,6 @@ Patching rules: data?: Record } - export type PutTwinDocumentRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1153,7 +1074,6 @@ export type PutTwinDocumentRequest = { data?: Record } - export type RenewDeviceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1165,7 +1085,6 @@ export type RenewDeviceCertificateRequest = { deviceId: string } - export interface RenewDeviceCertificateResponse { /** * Information related to the created device. @@ -1177,7 +1096,6 @@ export interface RenewDeviceCertificateResponse { certificate?: Certificate } - export interface Route { /** * Route ID. @@ -1231,7 +1149,6 @@ export interface Route { region: ScwRegion } - export type SetDeviceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1247,13 +1164,11 @@ export type SetDeviceCertificateRequest = { certificatePem: string } - export interface SetDeviceCertificateResponse { device?: Device certificatePem: string } - export type SetHubCARequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1273,7 +1188,6 @@ export type SetHubCARequest = { challengeCertPem: string } - export interface TwinDocument { /** * Parent twin ID of the document. @@ -1293,7 +1207,6 @@ export interface TwinDocument { data?: Record } - export type UpdateDeviceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1325,7 +1238,6 @@ export type UpdateDeviceRequest = { hubId?: string } - export type UpdateHubRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1363,7 +1275,6 @@ export type UpdateHubRequest = { twinsGraphiteConfig?: HubTwinsGraphiteConfig } - export type UpdateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1400,5 +1311,3 @@ export type UpdateRouteRequest = { */ restConfig?: UpdateRouteRequestRestConfig } - - diff --git a/packages_generated/ipam/src/v1/api.gen.ts b/packages_generated/ipam/src/v1/api.gen.ts index c28cb1abe..a10dc592a 100644 --- a/packages_generated/ipam/src/v1/api.gen.ts +++ b/packages_generated/ipam/src/v1/api.gen.ts @@ -8,7 +8,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalAttachIPRequest, marshalBookIPRequest, @@ -47,15 +47,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Reserve a new IP. Reserve a new IP from the specified source. Currently IPs can only be reserved from a Private Network. * @@ -75,36 +70,29 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Release an IP. Release an IP not currently attached to a resource, and returns it to the available IP pool. * * @param request - The request {@link ReleaseIPRequest} */ releaseIP = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'DELETE', - path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'DELETE', + path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`, + }) - releaseIPSet = (request: Readonly = {}) => - this.client.fetch( - { - body: JSON.stringify( - marshalReleaseIPSetRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalReleaseIPSetRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`, + }) - /** * Get an IP. Retrieve details of an existing IP, specified by its IP ID. * @@ -120,7 +108,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Update an IP. Update parameters including tags of the specified IP. * @@ -140,7 +127,6 @@ export class API extends ParentAPI { unmarshalIP, ) - protected pageOfListIPs = (request: Readonly = {}) => this.client.fetch( { @@ -154,7 +140,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['resource_id', request.resourceId], ['resource_ids', request.resourceIds], @@ -162,26 +151,20 @@ export class API extends ParentAPI { ['resource_type', request.resourceType], ['resource_types', request.resourceTypes], ['tags', request.tags], - ['vpc_id', request.vpcId], - ...Object.entries(resolveOneOf([ - {param: 'zonal', - value: request.zonal, - }, - {param: 'private_network_id', - value: request.privateNetworkId, - }, - {param: 'subnet_id', - value: request.subnetId, - }, - {param: 'source_vpc_id', - value: request.sourceVpcId, - }, - ])), + ['vpc_id', request.vpcId], + ...Object.entries( + resolveOneOf([ + { param: 'zonal', value: request.zonal }, + { param: 'private_network_id', value: request.privateNetworkId }, + { param: 'subnet_id', value: request.subnetId }, + { param: 'source_vpc_id', value: request.sourceVpcId }, + ]), + ), ), }, unmarshalListIPsResponse, ) - + /** * List existing IPs. List existing IPs in the specified region using various filters. For example, you can filter for IPs within a specified Private Network, or for public IPs within a specified Project. By default, the IPs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. * @@ -191,7 +174,6 @@ export class API extends ParentAPI { listIPs = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIPs, request) - /** * Attach IP to custom resource. Attach an existing reserved IP from a Private Network subnet to a custom, named resource via its MAC address. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for attaching IP addresses to standard Scaleway resources as it will fail - see the relevant product API for an equivalent method. * @@ -211,7 +193,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Detach IP from a custom resource. Detach a private IP from a custom resource. An example of a custom resource is a virtual machine hosted on an Elastic Metal server. Do not use this method for detaching IP addresses from standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. * @@ -231,7 +212,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Move IP to a custom resource. Move an existing reserved private IP from one custom resource (e.g. a virtual machine hosted on an Elastic Metal server) to another custom resource. This will detach it from the first resource, and attach it to the second. Do not use this method for moving IP addresses between standard Scaleway resources (e.g. Instances, Load Balancers) as it will fail - see the relevant product API for an equivalent method. * @@ -250,7 +230,4 @@ export class API extends ParentAPI { }, unmarshalIP, ) - - } - diff --git a/packages_generated/ipam/src/v1/index.gen.ts b/packages_generated/ipam/src/v1/index.gen.ts index e89771091..c00dada34 100644 --- a/packages_generated/ipam/src/v1/index.gen.ts +++ b/packages_generated/ipam/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { AttachIPRequest, diff --git a/packages_generated/ipam/src/v1/marshalling.gen.ts b/packages_generated/ipam/src/v1/marshalling.gen.ts index 964c84172..1dec2f9f4 100644 --- a/packages_generated/ipam/src/v1/marshalling.gen.ts +++ b/packages_generated/ipam/src/v1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Resource, @@ -107,26 +111,18 @@ export const marshalAttachIPRequest = ( request: AttachIPRequest, defaults: DefaultValues, ): Record => ({ - resource: marshalCustomResource(request.resource, defaults), + resource: marshalCustomResource(request.resource, defaults), }) const marshalSource = ( request: Source, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'zonal', - value: request.zonal, - }, - {param: 'private_network_id', - value: request.privateNetworkId, - }, - {param: 'subnet_id', - value: request.subnetId, - }, - {param: 'vpc_id', - value: request.vpcId, - }, + { param: 'zonal', value: request.zonal }, + { param: 'private_network_id', value: request.privateNetworkId }, + { param: 'subnet_id', value: request.subnetId }, + { param: 'vpc_id', value: request.vpcId }, ]), }) @@ -137,8 +133,11 @@ export const marshalBookIPRequest = ( address: request.address, is_ipv6: request.isIpv6, project_id: request.projectId ?? defaults.defaultProjectId, - resource: ((request.resource !== undefined) ? marshalCustomResource(request.resource, defaults): undefined), - source: marshalSource(request.source, defaults), + resource: + request.resource !== undefined + ? marshalCustomResource(request.resource, defaults) + : undefined, + source: marshalSource(request.source, defaults), tags: request.tags, }) @@ -146,15 +145,18 @@ export const marshalDetachIPRequest = ( request: DetachIPRequest, defaults: DefaultValues, ): Record => ({ - resource: marshalCustomResource(request.resource, defaults), + resource: marshalCustomResource(request.resource, defaults), }) export const marshalMoveIPRequest = ( request: MoveIPRequest, defaults: DefaultValues, ): Record => ({ - from_resource: marshalCustomResource(request.fromResource, defaults), - to_resource: ((request.toResource !== undefined) ? marshalCustomResource(request.toResource, defaults): undefined), + from_resource: marshalCustomResource(request.fromResource, defaults), + to_resource: + request.toResource !== undefined + ? marshalCustomResource(request.toResource, defaults) + : undefined, }) export const marshalReleaseIPSetRequest = ( @@ -176,6 +178,9 @@ export const marshalUpdateIPRequest = ( request: UpdateIPRequest, defaults: DefaultValues, ): Record => ({ - reverses: ((request.reverses !== undefined) ? request.reverses.map(elt => marshalReverse(elt, defaults)): undefined), + reverses: + request.reverses !== undefined + ? request.reverses.map(elt => marshalReverse(elt, defaults)) + : undefined, tags: request.tags, }) diff --git a/packages_generated/ipam/src/v1/types.gen.ts b/packages_generated/ipam/src/v1/types.gen.ts index 606c1b454..ade72d5be 100644 --- a/packages_generated/ipam/src/v1/types.gen.ts +++ b/packages_generated/ipam/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' export type ListIPsRequestOrderBy = | 'created_at_desc' @@ -65,7 +64,6 @@ export interface Resource { name?: string } - export interface Reverse { /** * Reverse domain name. @@ -77,7 +75,6 @@ export interface Reverse { address?: string } - export interface Source { /** * This source is global. @@ -104,7 +101,6 @@ export interface Source { vpcId?: string } - export interface CustomResource { /** * MAC address of the custom resource. @@ -116,7 +112,6 @@ export interface CustomResource { name?: string } - export interface IP { /** * IP ID. @@ -168,7 +163,6 @@ export interface IP { zone?: ScwZone } - export type AttachIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -184,7 +178,6 @@ export type AttachIPRequest = { resource: CustomResource } - export type BookIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -216,7 +209,6 @@ export type BookIPRequest = { resource?: CustomResource } - export type DetachIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -232,7 +224,6 @@ export type DetachIPRequest = { resource: CustomResource } - export type GetIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -244,7 +235,6 @@ export type GetIPRequest = { ipId: string } - export type ListIPsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -339,13 +329,11 @@ export type ListIPsRequest = { sourceVpcId?: string } - export interface ListIPsResponse { totalCount: number ips: IP[] } - export type MoveIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -365,7 +353,6 @@ export type MoveIPRequest = { toResource?: CustomResource } - export type ReleaseIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -377,7 +364,6 @@ export type ReleaseIPRequest = { ipId: string } - export type ReleaseIPSetRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -386,7 +372,6 @@ export type ReleaseIPSetRequest = { ipIds?: string[] } - export type UpdateIPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -405,5 +390,3 @@ export type UpdateIPRequest = { */ reverses?: Reverse[] } - - diff --git a/packages_generated/jobs/src/v1alpha1/api.gen.ts b/packages_generated/jobs/src/v1alpha1/api.gen.ts index 293961661..7c32acebc 100644 --- a/packages_generated/jobs/src/v1alpha1/api.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalCreateJobDefinitionRequest, marshalCreateJobDefinitionSecretsRequest, @@ -68,15 +68,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Create a new job definition in a specified Project. * @@ -96,7 +91,6 @@ export class API extends ParentAPI { unmarshalJobDefinition, ) - /** * Get a job definition by its unique identifier. * @@ -112,8 +106,9 @@ export class API extends ParentAPI { unmarshalJobDefinition, ) - - protected pageOfListJobDefinitions = (request: Readonly = {}) => + protected pageOfListJobDefinitions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -122,13 +117,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListJobDefinitionsResponse, ) - + /** * List all your job definitions with filters. * @@ -136,9 +134,12 @@ export class API extends ParentAPI { * @returns A Promise of ListJobDefinitionsResponse */ listJobDefinitions = (request: Readonly = {}) => - enrichForPagination('jobDefinitions', this.pageOfListJobDefinitions, request) + enrichForPagination( + 'jobDefinitions', + this.pageOfListJobDefinitions, + request, + ) - /** * Update an existing job definition associated with the specified unique identifier. * @@ -158,21 +159,17 @@ export class API extends ParentAPI { unmarshalJobDefinition, ) - /** * Delete an existing job definition by its unique identifier. * * @param request - The request {@link DeleteJobDefinitionRequest} */ deleteJobDefinition = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}`, + }) - /** * Run an existing job definition by its unique identifier. This will create a new job run. * @@ -192,18 +189,22 @@ export class API extends ParentAPI { unmarshalStartJobDefinitionResponse, ) - /** * Create a secret reference within a job definition. * * @param request - The request {@link CreateJobDefinitionSecretsRequest} * @returns A Promise of CreateJobDefinitionSecretsResponse */ - createJobDefinitionSecrets = (request: Readonly) => + createJobDefinitionSecrets = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalCreateJobDefinitionSecretsRequest(request, this.client.settings), + marshalCreateJobDefinitionSecretsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -212,7 +213,6 @@ export class API extends ParentAPI { unmarshalCreateJobDefinitionSecretsResponse, ) - /** * Get a secret references within a job definition. * @@ -228,14 +228,15 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * List secrets references within a job definition. * * @param request - The request {@link ListJobDefinitionSecretsRequest} * @returns A Promise of ListJobDefinitionSecretsResponse */ - listJobDefinitionSecrets = (request: Readonly) => + listJobDefinitionSecrets = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -244,18 +245,22 @@ export class API extends ParentAPI { unmarshalListJobDefinitionSecretsResponse, ) - /** * Update a secret reference within a job definition. * * @param request - The request {@link UpdateJobDefinitionSecretRequest} * @returns A Promise of Secret */ - updateJobDefinitionSecret = (request: Readonly) => + updateJobDefinitionSecret = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalUpdateJobDefinitionSecretRequest(request, this.client.settings), + marshalUpdateJobDefinitionSecretRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -264,21 +269,19 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Delete a secret reference within a job definition. * * @param request - The request {@link DeleteJobDefinitionSecretRequest} */ - deleteJobDefinitionSecret = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}/secrets/${validatePathParam('secretId', request.secretId)}`, - }, - ) + deleteJobDefinitionSecret = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/serverless-jobs/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/job-definitions/${validatePathParam('jobDefinitionId', request.jobDefinitionId)}/secrets/${validatePathParam('secretId', request.secretId)}`, + }) - /** * Get a job run by its unique identifier. * @@ -294,7 +297,6 @@ export class API extends ParentAPI { unmarshalJobRun, ) - /** * Stop a job run by its unique identifier. * @@ -312,7 +314,6 @@ export class API extends ParentAPI { unmarshalJobRun, ) - protected pageOfListJobRuns = (request: Readonly = {}) => this.client.fetch( { @@ -323,7 +324,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['state', request.state], ['states', request.states], @@ -331,7 +335,7 @@ export class API extends ParentAPI { }, unmarshalListJobRunsResponse, ) - + /** * List all job runs with filters. * @@ -341,7 +345,6 @@ export class API extends ParentAPI { listJobRuns = (request: Readonly = {}) => enrichForPagination('jobRuns', this.pageOfListJobRuns, request) - /** * List jobs resources for the console. * @@ -357,7 +360,6 @@ export class API extends ParentAPI { unmarshalListJobsResourcesResponse, ) - /** * Get jobs limits for the console. * @@ -372,7 +374,4 @@ export class API extends ParentAPI { }, unmarshalJobsLimits, ) - - } - diff --git a/packages_generated/jobs/src/v1alpha1/content.gen.ts b/packages_generated/jobs/src/v1alpha1/content.gen.ts index 7aa100ad6..59ed63fd3 100644 --- a/packages_generated/jobs/src/v1alpha1/content.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - JobRunState, -} from './types.gen.js' - +import type { JobRunState } from './types.gen.js' /** Lists transient statutes of the enum {@link JobRunState}. */ export const JOB_RUN_TRANSIENT_STATUSES: JobRunState[] = [ @@ -11,4 +8,3 @@ export const JOB_RUN_TRANSIENT_STATUSES: JobRunState[] = [ 'scheduled', 'running', ] - diff --git a/packages_generated/jobs/src/v1alpha1/index.gen.ts b/packages_generated/jobs/src/v1alpha1/index.gen.ts index f4a73dfd0..9b3f0117b 100644 --- a/packages_generated/jobs/src/v1alpha1/index.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/jobs/src/v1alpha1/marshalling.gen.ts b/packages_generated/jobs/src/v1alpha1/marshalling.gen.ts index f8ec5a4f3..e6d1f8744 100644 --- a/packages_generated/jobs/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { SecretEnvVar, @@ -92,7 +97,9 @@ export const unmarshalJobDefinition = (data: unknown): JobDefinition => { command: data.command, cpuLimit: data.cpu_limit, createdAt: unmarshalDate(data.created_at), - cronSchedule: data.cron_schedule ? unmarshalCronSchedule(data.cron_schedule) : undefined, + cronSchedule: data.cron_schedule + ? unmarshalCronSchedule(data.cron_schedule) + : undefined, description: data.description, environmentVariables: data.environment_variables, id: data.id, @@ -134,7 +141,9 @@ export const unmarshalJobRun = (data: unknown): JobRun => { } as JobRun } -export const unmarshalCreateJobDefinitionSecretsResponse = (data: unknown): CreateJobDefinitionSecretsResponse => { +export const unmarshalCreateJobDefinitionSecretsResponse = ( + data: unknown, +): CreateJobDefinitionSecretsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateJobDefinitionSecretsResponse' failed as data isn't a dictionary.`, @@ -158,7 +167,9 @@ export const unmarshalJobsLimits = (data: unknown): JobsLimits => { } as JobsLimits } -export const unmarshalListJobDefinitionSecretsResponse = (data: unknown): ListJobDefinitionSecretsResponse => { +export const unmarshalListJobDefinitionSecretsResponse = ( + data: unknown, +): ListJobDefinitionSecretsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListJobDefinitionSecretsResponse' failed as data isn't a dictionary.`, @@ -171,7 +182,9 @@ export const unmarshalListJobDefinitionSecretsResponse = (data: unknown): ListJo } as ListJobDefinitionSecretsResponse } -export const unmarshalListJobDefinitionsResponse = (data: unknown): ListJobDefinitionsResponse => { +export const unmarshalListJobDefinitionsResponse = ( + data: unknown, +): ListJobDefinitionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListJobDefinitionsResponse' failed as data isn't a dictionary.`, @@ -179,12 +192,17 @@ export const unmarshalListJobDefinitionsResponse = (data: unknown): ListJobDefin } return { - jobDefinitions: unmarshalArrayOfObject(data.job_definitions, unmarshalJobDefinition), + jobDefinitions: unmarshalArrayOfObject( + data.job_definitions, + unmarshalJobDefinition, + ), totalCount: data.total_count, } as ListJobDefinitionsResponse } -export const unmarshalListJobRunsResponse = (data: unknown): ListJobRunsResponse => { +export const unmarshalListJobRunsResponse = ( + data: unknown, +): ListJobRunsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListJobRunsResponse' failed as data isn't a dictionary.`, @@ -210,7 +228,9 @@ const unmarshalResource = (data: unknown): Resource => { } as Resource } -export const unmarshalListJobsResourcesResponse = (data: unknown): ListJobsResourcesResponse => { +export const unmarshalListJobsResourcesResponse = ( + data: unknown, +): ListJobsResourcesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListJobsResourcesResponse' failed as data isn't a dictionary.`, @@ -222,7 +242,9 @@ export const unmarshalListJobsResourcesResponse = (data: unknown): ListJobsResou } as ListJobsResourcesResponse } -export const unmarshalStartJobDefinitionResponse = (data: unknown): StartJobDefinitionResponse => { +export const unmarshalStartJobDefinitionResponse = ( + data: unknown, +): StartJobDefinitionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'StartJobDefinitionResponse' failed as data isn't a dictionary.`, @@ -248,9 +270,18 @@ export const marshalCreateJobDefinitionRequest = ( ): Record => ({ command: request.command, cpu_limit: request.cpuLimit, - cron_schedule: ((request.cronSchedule !== undefined) ? marshalCreateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults): undefined), + cron_schedule: + request.cronSchedule !== undefined + ? marshalCreateJobDefinitionRequestCronScheduleConfig( + request.cronSchedule, + defaults, + ) + : undefined, description: request.description, - environment_variables: ((request.environmentVariables !== undefined) ? request.environmentVariables: undefined), + environment_variables: + request.environmentVariables !== undefined + ? request.environmentVariables + : undefined, image_uri: request.imageUri, job_timeout: request.jobTimeout, local_storage_capacity: request.localStorageCapacity, @@ -264,14 +295,10 @@ const marshalCreateJobDefinitionSecretsRequestSecretConfig = ( defaults: DefaultValues, ): Record => ({ secret_manager_id: request.secretManagerId, - secret_manager_version: request.secretManagerVersion, + secret_manager_version: request.secretManagerVersion, ...resolveOneOf([ - {param: 'path', - value: request.path, - }, - {param: 'env_var_name', - value: request.envVarName, - }, + { param: 'path', value: request.path }, + { param: 'env_var_name', value: request.envVarName }, ]), }) @@ -279,7 +306,9 @@ export const marshalCreateJobDefinitionSecretsRequest = ( request: CreateJobDefinitionSecretsRequest, defaults: DefaultValues, ): Record => ({ - secrets: request.secrets.map(elt => marshalCreateJobDefinitionSecretsRequestSecretConfig(elt, defaults)), + secrets: request.secrets.map(elt => + marshalCreateJobDefinitionSecretsRequestSecretConfig(elt, defaults), + ), }) export const marshalStartJobDefinitionRequest = ( @@ -305,7 +334,13 @@ export const marshalUpdateJobDefinitionRequest = ( ): Record => ({ command: request.command, cpu_limit: request.cpuLimit, - cron_schedule: ((request.cronSchedule !== undefined) ? marshalUpdateJobDefinitionRequestCronScheduleConfig(request.cronSchedule, defaults): undefined), + cron_schedule: + request.cronSchedule !== undefined + ? marshalUpdateJobDefinitionRequestCronScheduleConfig( + request.cronSchedule, + defaults, + ) + : undefined, description: request.description, environment_variables: request.environmentVariables, image_uri: request.imageUri, @@ -319,13 +354,9 @@ export const marshalUpdateJobDefinitionSecretRequest = ( request: UpdateJobDefinitionSecretRequest, defaults: DefaultValues, ): Record => ({ - secret_manager_version: request.secretManagerVersion, + secret_manager_version: request.secretManagerVersion, ...resolveOneOf([ - {param: 'path', - value: request.path, - }, - {param: 'env_var_name', - value: request.envVarName, - }, + { param: 'path', value: request.path }, + { param: 'env_var_name', value: request.envVarName }, ]), }) diff --git a/packages_generated/jobs/src/v1alpha1/types.gen.ts b/packages_generated/jobs/src/v1alpha1/types.gen.ts index 075527cc0..acbd0a716 100644 --- a/packages_generated/jobs/src/v1alpha1/types.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type JobRunState = | 'unknown_state' @@ -17,20 +16,16 @@ export type ListJobDefinitionsRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListJobRunsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListJobRunsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export interface SecretEnvVar { name: string } - export interface SecretFile { path: string } - export interface CronSchedule { /** * UNIX cron schedule to run job (e.g., '* * * * *'). @@ -42,13 +37,11 @@ export interface CronSchedule { timezone: string } - export interface CreateJobDefinitionRequestCronScheduleConfig { schedule: string timezone: string } - export interface CreateJobDefinitionSecretsRequestSecretConfig { secretManagerId: string secretManagerVersion: string @@ -64,7 +57,6 @@ export interface CreateJobDefinitionSecretsRequestSecretConfig { envVarName?: string } - export interface Secret { /** * UUID of the secret reference within the job. @@ -92,7 +84,6 @@ export interface Secret { envVar?: SecretEnvVar } - export interface JobDefinition { id: string name: string @@ -114,7 +105,6 @@ export interface JobDefinition { region: ScwRegion } - export interface JobRun { id: string jobDefinitionId: string @@ -137,19 +127,16 @@ export interface JobRun { region: ScwRegion } - export interface Resource { cpuLimit: number memoryLimit: number } - export interface UpdateJobDefinitionRequestCronScheduleConfig { schedule?: string timezone?: string } - export type CreateJobDefinitionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -201,7 +188,6 @@ export type CreateJobDefinitionRequest = { cronSchedule?: CreateJobDefinitionRequestCronScheduleConfig } - export type CreateJobDefinitionSecretsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -217,7 +203,6 @@ export type CreateJobDefinitionSecretsRequest = { secrets: CreateJobDefinitionSecretsRequestSecretConfig[] } - export interface CreateJobDefinitionSecretsResponse { /** * List of secrets created. @@ -225,7 +210,6 @@ export interface CreateJobDefinitionSecretsResponse { secrets: Secret[] } - export type DeleteJobDefinitionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -237,7 +221,6 @@ export type DeleteJobDefinitionRequest = { jobDefinitionId: string } - export type DeleteJobDefinitionSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -253,7 +236,6 @@ export type DeleteJobDefinitionSecretRequest = { secretId: string } - export type GetJobDefinitionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -265,7 +247,6 @@ export type GetJobDefinitionRequest = { jobDefinitionId: string } - export type GetJobDefinitionSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -281,7 +262,6 @@ export type GetJobDefinitionSecretRequest = { secretId: string } - export type GetJobRunRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -293,7 +273,6 @@ export type GetJobRunRequest = { jobRunId: string } - export type GetJobsLimitsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -301,12 +280,10 @@ export type GetJobsLimitsRequest = { region?: ScwRegion } - export interface JobsLimits { secretsPerJobDefinition: number } - export type ListJobDefinitionSecretsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -318,7 +295,6 @@ export type ListJobDefinitionSecretsRequest = { jobDefinitionId: string } - export interface ListJobDefinitionSecretsResponse { /** * List of secret references within a job definition. @@ -330,7 +306,6 @@ export interface ListJobDefinitionSecretsResponse { totalCount: number } - export type ListJobDefinitionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -343,13 +318,11 @@ export type ListJobDefinitionsRequest = { organizationId?: string } - export interface ListJobDefinitionsResponse { jobDefinitions: JobDefinition[] totalCount: number } - export type ListJobRunsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -365,13 +338,11 @@ export type ListJobRunsRequest = { states?: JobRunState[] } - export interface ListJobRunsResponse { jobRuns: JobRun[] totalCount: number } - export type ListJobsResourcesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -379,12 +350,10 @@ export type ListJobsResourcesRequest = { region?: ScwRegion } - export interface ListJobsResourcesResponse { resources: Resource[] } - export type StartJobDefinitionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -408,12 +377,10 @@ export type StartJobDefinitionRequest = { replicas?: number } - export interface StartJobDefinitionResponse { jobRuns: JobRun[] } - export type StopJobRunRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -425,7 +392,6 @@ export type StopJobRunRequest = { jobRunId: string } - export type UpdateJobDefinitionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -474,7 +440,6 @@ export type UpdateJobDefinitionRequest = { cronSchedule?: UpdateJobDefinitionRequestCronScheduleConfig } - export type UpdateJobDefinitionSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -505,5 +470,3 @@ export type UpdateJobDefinitionSecretRequest = { */ envVarName?: string } - - diff --git a/packages_generated/jobs/src/v1alpha1/validation-rules.gen.ts b/packages_generated/jobs/src/v1alpha1/validation-rules.gen.ts index e1312ee49..cba44c0d6 100644 --- a/packages_generated/jobs/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/jobs/src/v1alpha1/validation-rules.gen.ts @@ -9,7 +9,8 @@ export const CreateJobDefinitionRequest = { maxLength: 255, }, imageUri: { - 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,}))?$/, + 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,}))?$/, }, localStorageCapacity: { greaterThan: 0, @@ -84,7 +85,8 @@ export const UpdateJobDefinitionRequest = { maxLength: 255, }, imageUri: { - 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,}))?$/, + 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,}))?$/, }, localStorageCapacity: { greaterThan: 0, diff --git a/packages_generated/k8s/src/v1/api.gen.ts b/packages_generated/k8s/src/v1/api.gen.ts index a412a58ef..eadd51c81 100644 --- a/packages_generated/k8s/src/v1/api.gen.ts +++ b/packages_generated/k8s/src/v1/api.gen.ts @@ -8,8 +8,12 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_K8S,NODE_TRANSIENT_STATUSES as NODE_TRANSIENT_STATUSES_K8S,POOL_TRANSIENT_STATUSES as POOL_TRANSIENT_STATUSES_K8S,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_K8S, + NODE_TRANSIENT_STATUSES as NODE_TRANSIENT_STATUSES_K8S, + POOL_TRANSIENT_STATUSES as POOL_TRANSIENT_STATUSES_K8S, +} from './content.gen.js' import { marshalAddClusterACLRulesRequest, unmarshalAddClusterACLRulesResponse, @@ -106,16 +110,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListClusters = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListClusters = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -125,7 +126,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status], @@ -134,7 +138,7 @@ export class API extends ParentAPI { }, unmarshalListClustersResponse, ) - + /** * List Clusters. List all existing Kubernetes clusters in a specific region. * @@ -144,7 +148,6 @@ export class API extends ParentAPI { listClusters = (request: Readonly = {}) => enrichForPagination('clusters', this.pageOfListClusters, request) - /** * Create a new Cluster. Create a new Kubernetes cluster in a Scaleway region. * @@ -164,7 +167,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get a Cluster. Retrieve information about a specific Kubernetes cluster. * @@ -179,7 +181,7 @@ export class API extends ParentAPI { }, unmarshalCluster, ) - + /** * Waits for {@link Cluster} to be in a final state. * @@ -192,13 +194,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES_K8S.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CLUSTER_TRANSIENT_STATUSES_K8S.includes(res.status), + )), this.getCluster, request, options, ) - /** * Update a Cluster. Update information on a specific Kubernetes cluster. You can update details such as its name, description, tags and configuration. To upgrade a cluster, you will need to use the dedicated endpoint. * @@ -218,7 +223,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Delete a Cluster. Delete a specific Kubernetes cluster and all its associated pools and nodes, and possibly its associated Load Balancers or Block Volumes. * @@ -230,14 +234,14 @@ export class API extends ParentAPI { { method: 'DELETE', path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}`, - urlParams: urlParams( - ['with_additional_resources', request.withAdditionalResources], - ), + urlParams: urlParams([ + 'with_additional_resources', + request.withAdditionalResources, + ]), }, unmarshalCluster, ) - /** * Upgrade a Cluster. Upgrade a specific Kubernetes cluster and possibly its associated pools to a specific and supported Kubernetes version. * @@ -257,7 +261,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Change the Cluster type. Change the type of a specific Kubernetes cluster. To see the possible values you can enter for the `type` field, [list available cluster types](#list-available-cluster-types-for-a-cluster). * @@ -277,14 +280,15 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * List available versions for a Cluster. List the versions that a specific Kubernetes cluster is allowed to upgrade to. Results will include every patch version greater than the current patch, as well as one minor version ahead of the current version. Any upgrade skipping a minor version will not work. * * @param request - The request {@link ListClusterAvailableVersionsRequest} * @returns A Promise of ListClusterAvailableVersionsResponse */ - listClusterAvailableVersions = (request: Readonly) => + listClusterAvailableVersions = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -293,14 +297,15 @@ export class API extends ParentAPI { unmarshalListClusterAvailableVersionsResponse, ) - /** * List available cluster types for a cluster. List the cluster types that a specific Kubernetes cluster is allowed to switch to. * * @param request - The request {@link ListClusterAvailableTypesRequest} * @returns A Promise of ListClusterAvailableTypesResponse */ - listClusterAvailableTypes = (request: Readonly) => + listClusterAvailableTypes = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -309,50 +314,47 @@ export class API extends ParentAPI { unmarshalListClusterAvailableTypesResponse, ) - - protected _getClusterKubeConfig = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`, - urlParams: urlParams( - ['dl', 1], - ['redacted', request.redacted], - ), - responseType: 'blob', - }, - ) + protected _getClusterKubeConfig = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'GET', + path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/kubeconfig`, + urlParams: urlParams(['dl', 1], ['redacted', request.redacted]), + responseType: 'blob', + }) - /** * Reset the admin token of a Cluster. Reset the admin token for a specific Kubernetes cluster. This will revoke the old admin token (which will not be usable afterwards) and create a new one. Note that you will need to download the kubeconfig again to keep interacting with the cluster. * * @param request - The request {@link ResetClusterAdminTokenRequest} */ resetClusterAdminToken = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/reset-admin-token`, + }) - - protected pageOfListClusterACLRules = (request: Readonly) => + protected pageOfListClusterACLRules = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/acls`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListClusterACLRulesResponse, ) - + /** * List ACLs. List ACLs for a specific cluster. * @@ -362,7 +364,6 @@ export class API extends ParentAPI { listClusterACLRules = (request: Readonly) => enrichForPagination('rules', this.pageOfListClusterACLRules, request) - /** * Add new ACLs. Add new ACL rules for a specific cluster. * @@ -382,7 +383,6 @@ export class API extends ParentAPI { unmarshalAddClusterACLRulesResponse, ) - /** * Set new ACLs. Set new ACL rules for a specific cluster. * @@ -402,21 +402,17 @@ export class API extends ParentAPI { unmarshalSetClusterACLRulesResponse, ) - /** * Delete an existing ACL. * * @param request - The request {@link DeleteACLRuleRequest} */ deleteACLRule = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`, + }) - protected pageOfListPools = (request: Readonly) => this.client.fetch( { @@ -426,13 +422,16 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['status', request.status], ), }, unmarshalListPoolsResponse, ) - + /** * List Pools in a Cluster. List all the existing pools for a specific Kubernetes cluster. * @@ -442,7 +441,6 @@ export class API extends ParentAPI { listPools = (request: Readonly) => enrichForPagination('pools', this.pageOfListPools, request) - /** * Create a new Pool in a Cluster. Create a new pool in a specific Kubernetes cluster. * @@ -462,7 +460,6 @@ export class API extends ParentAPI { unmarshalPool, ) - /** * Get a Pool in a Cluster. Retrieve details about a specific pool in a Kubernetes cluster. * @@ -477,7 +474,7 @@ export class API extends ParentAPI { }, unmarshalPool, ) - + /** * Waits for {@link Pool} to be in a final state. * @@ -490,13 +487,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!POOL_TRANSIENT_STATUSES_K8S.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!POOL_TRANSIENT_STATUSES_K8S.includes(res.status))), this.getPool, request, options, ) - /** * Upgrade a Pool in a Cluster. Upgrade the Kubernetes version of a specific pool. Note that it only works if the targeted version matches the cluster's version. This will drain and replace the nodes in that pool. @@ -517,7 +515,6 @@ This will drain and replace the nodes in that pool. unmarshalPool, ) - /** * Update a Pool in a Cluster. Update the attributes of a specific pool, such as its desired size, autoscaling settings, and tags. To upgrade a pool, you will need to use the dedicated endpoint. * @@ -537,7 +534,6 @@ This will drain and replace the nodes in that pool. unmarshalPool, ) - /** * Delete a Pool in a Cluster. Delete a specific pool from a cluster. Note that all the pool's nodes will also be deleted. * @@ -553,25 +549,23 @@ This will drain and replace the nodes in that pool. unmarshalPool, ) - /** * Migrate specific pools or all pools of a cluster to new images.. If no pool is specified, all pools of the cluster will be migrated to new images. * * @param request - The request {@link MigratePoolsToNewImagesRequest} */ - migratePoolsToNewImages = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalMigratePoolsToNewImagesRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-pools-to-new-images`, - }, - ) + migratePoolsToNewImages = ( + request: Readonly, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalMigratePoolsToNewImagesRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/migrate-pools-to-new-images`, + }) - /** * Fetch node metadata. Rerieve metadata to instantiate a Kapsule/Kosmos node. This method is not intended to be called by end users but rather programmatically by the node-installer. * @@ -587,7 +581,6 @@ This will drain and replace the nodes in that pool. unmarshalNodeMetadata, ) - /** * Authenticate Kosmos external node. Creates a newer Kosmos node and returns its token. This method is not intended to be called by end users but rather programmatically by the node-installer. * @@ -605,7 +598,6 @@ This will drain and replace the nodes in that pool. unmarshalExternalNodeAuth, ) - /** * Create a Kosmos node. Retrieve metadata for a Kosmos node. This method is not intended to be called by end users but rather programmatically by the kapsule-node-agent. * @@ -623,7 +615,6 @@ This will drain and replace the nodes in that pool. unmarshalExternalNode, ) - protected pageOfListNodes = (request: Readonly) => this.client.fetch( { @@ -633,14 +624,17 @@ This will drain and replace the nodes in that pool. ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['pool_id', request.poolId], ['status', request.status], ), }, unmarshalListNodesResponse, ) - + /** * List Nodes in a Cluster. List all the existing nodes for a specific Kubernetes cluster. * @@ -650,7 +644,6 @@ This will drain and replace the nodes in that pool. listNodes = (request: Readonly) => enrichForPagination('nodes', this.pageOfListNodes, request) - /** * Get a Node in a Cluster. Retrieve details about a specific Kubernetes Node. * @@ -665,7 +658,7 @@ This will drain and replace the nodes in that pool. }, unmarshalNode, ) - + /** * Waits for {@link Node} to be in a final state. * @@ -678,13 +671,14 @@ This will drain and replace the nodes in that pool. options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!NODE_TRANSIENT_STATUSES_K8S.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!NODE_TRANSIENT_STATUSES_K8S.includes(res.status))), this.getNode, request, options, ) - /** * Replace a Node in a Cluster. Replace a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur. * @@ -703,7 +697,6 @@ This will drain and replace the nodes in that pool. unmarshalNode, ) - /** * Reboot a Node in a Cluster. Reboot a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur. * @@ -721,7 +714,6 @@ This will drain and replace the nodes in that pool. unmarshalNode, ) - /** * Delete a Node in a Cluster. Delete a specific Node. The node will first be drained and pods will be rescheduled onto another node. Note that when there is not enough space to reschedule all the pods (such as in a one-node cluster, or with specific constraints), disruption of your applications may occur. * @@ -741,7 +733,6 @@ This will drain and replace the nodes in that pool. unmarshalNode, ) - /** * List all available Versions. List all available versions for the creation of a new Kubernetes cluster. * @@ -757,7 +748,6 @@ This will drain and replace the nodes in that pool. unmarshalListVersionsResponse, ) - /** * Get a Version. Retrieve a specific Kubernetes version and its details. * @@ -773,20 +763,24 @@ This will drain and replace the nodes in that pool. unmarshalVersion, ) - - protected pageOfListClusterTypes = (request: Readonly = {}) => + protected pageOfListClusterTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/k8s/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/cluster-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListClusterTypesResponse, ) - + /** * List cluster types. List available cluster types and their technical details. * @@ -795,7 +789,4 @@ This will drain and replace the nodes in that pool. */ listClusterTypes = (request: Readonly = {}) => enrichForPagination('clusterTypes', this.pageOfListClusterTypes, request) - - } - diff --git a/packages_generated/k8s/src/v1/content.gen.ts b/packages_generated/k8s/src/v1/content.gen.ts index ab4cb5693..83f81cf6b 100644 --- a/packages_generated/k8s/src/v1/content.gen.ts +++ b/packages_generated/k8s/src/v1/content.gen.ts @@ -1,11 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - ClusterStatus, - NodeStatus, - PoolStatus, -} from './types.gen.js' - +import type { ClusterStatus, NodeStatus, PoolStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link ClusterStatus}. */ export const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[] = [ @@ -30,4 +25,3 @@ export const POOL_TRANSIENT_STATUSES: PoolStatus[] = [ 'scaling', 'upgrading', ] - diff --git a/packages_generated/k8s/src/v1/index.gen.ts b/packages_generated/k8s/src/v1/index.gen.ts index 3ad11812d..91663d528 100644 --- a/packages_generated/k8s/src/v1/index.gen.ts +++ b/packages_generated/k8s/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/k8s/src/v1/marshalling.gen.ts b/packages_generated/k8s/src/v1/marshalling.gen.ts index 0b31dd1c5..03126f0ca 100644 --- a/packages_generated/k8s/src/v1/marshalling.gen.ts +++ b/packages_generated/k8s/src/v1/marshalling.gen.ts @@ -1,9 +1,16 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { + PoolUpgradePolicy, + Pool, Version, MaintenanceWindow, ClusterAutoUpgrade, @@ -11,8 +18,6 @@ import type { ClusterOpenIDConnectConfig, Cluster, Node, - PoolUpgradePolicy, - Pool, ACLRule, AddClusterACLRulesResponse, ExternalNodeCoreV1Taint, @@ -53,6 +58,57 @@ import type { UpgradePoolRequest, } from './types.gen.js' +const unmarshalPoolUpgradePolicy = (data: unknown): PoolUpgradePolicy => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`, + ) + } + + return { + maxSurge: data.max_surge, + maxUnavailable: data.max_unavailable, + } as PoolUpgradePolicy +} + +export const unmarshalPool = (data: unknown): Pool => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'Pool' failed as data isn't a dictionary.`, + ) + } + + return { + autohealing: data.autohealing, + autoscaling: data.autoscaling, + clusterId: data.cluster_id, + containerRuntime: data.container_runtime, + createdAt: unmarshalDate(data.created_at), + id: data.id, + kubeletArgs: data.kubelet_args, + maxSize: data.max_size, + minSize: data.min_size, + name: data.name, + newImagesEnabled: data.new_images_enabled, + nodeType: data.node_type, + placementGroupId: data.placement_group_id, + publicIpDisabled: data.public_ip_disabled, + region: data.region, + rootVolumeSize: data.root_volume_size, + rootVolumeType: data.root_volume_type, + securityGroupId: data.security_group_id, + size: data.size, + status: data.status, + tags: data.tags, + updatedAt: unmarshalDate(data.updated_at), + upgradePolicy: data.upgrade_policy + ? unmarshalPoolUpgradePolicy(data.upgrade_policy) + : undefined, + version: data.version, + zone: data.zone, + } as Pool +} + export const unmarshalVersion = (data: unknown): Version => { if (!isJSONObject(data)) { throw new TypeError( @@ -97,11 +153,15 @@ const unmarshalClusterAutoUpgrade = (data: unknown): ClusterAutoUpgrade => { return { enabled: data.enabled, - maintenanceWindow: data.maintenance_window ? unmarshalMaintenanceWindow(data.maintenance_window) : undefined, + maintenanceWindow: data.maintenance_window + ? unmarshalMaintenanceWindow(data.maintenance_window) + : undefined, } as ClusterAutoUpgrade } -const unmarshalClusterAutoscalerConfig = (data: unknown): ClusterAutoscalerConfig => { +const unmarshalClusterAutoscalerConfig = ( + data: unknown, +): ClusterAutoscalerConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ClusterAutoscalerConfig' failed as data isn't a dictionary.`, @@ -122,7 +182,9 @@ const unmarshalClusterAutoscalerConfig = (data: unknown): ClusterAutoscalerConfi } as ClusterAutoscalerConfig } -const unmarshalClusterOpenIDConnectConfig = (data: unknown): ClusterOpenIDConnectConfig => { +const unmarshalClusterOpenIDConnectConfig = ( + data: unknown, +): ClusterOpenIDConnectConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ClusterOpenIDConnectConfig' failed as data isn't a dictionary.`, @@ -151,8 +213,12 @@ export const unmarshalCluster = (data: unknown): Cluster => { aclAvailable: data.acl_available, admissionPlugins: data.admission_plugins, apiserverCertSans: data.apiserver_cert_sans, - autoUpgrade: data.auto_upgrade ? unmarshalClusterAutoUpgrade(data.auto_upgrade) : undefined, - autoscalerConfig: data.autoscaler_config ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) : undefined, + autoUpgrade: data.auto_upgrade + ? unmarshalClusterAutoUpgrade(data.auto_upgrade) + : undefined, + autoscalerConfig: data.autoscaler_config + ? unmarshalClusterAutoscalerConfig(data.autoscaler_config) + : undefined, clusterUrl: data.cluster_url, cni: data.cni, commitmentEndsAt: unmarshalDate(data.commitment_ends_at), @@ -164,7 +230,9 @@ export const unmarshalCluster = (data: unknown): Cluster => { id: data.id, name: data.name, newImagesEnabled: data.new_images_enabled, - openIdConnectConfig: data.open_id_connect_config ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) : undefined, + openIdConnectConfig: data.open_id_connect_config + ? unmarshalClusterOpenIDConnectConfig(data.open_id_connect_config) + : undefined, organizationId: data.organization_id, podCidr: data.pod_cidr, privateNetworkId: data.private_network_id, @@ -205,55 +273,6 @@ export const unmarshalNode = (data: unknown): Node => { } as Node } -const unmarshalPoolUpgradePolicy = (data: unknown): PoolUpgradePolicy => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PoolUpgradePolicy' failed as data isn't a dictionary.`, - ) - } - - return { - maxSurge: data.max_surge, - maxUnavailable: data.max_unavailable, - } as PoolUpgradePolicy -} - -export const unmarshalPool = (data: unknown): Pool => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'Pool' failed as data isn't a dictionary.`, - ) - } - - return { - autohealing: data.autohealing, - autoscaling: data.autoscaling, - clusterId: data.cluster_id, - containerRuntime: data.container_runtime, - createdAt: unmarshalDate(data.created_at), - id: data.id, - kubeletArgs: data.kubelet_args, - maxSize: data.max_size, - minSize: data.min_size, - name: data.name, - newImagesEnabled: data.new_images_enabled, - nodeType: data.node_type, - placementGroupId: data.placement_group_id, - publicIpDisabled: data.public_ip_disabled, - region: data.region, - rootVolumeSize: data.root_volume_size, - rootVolumeType: data.root_volume_type, - securityGroupId: data.security_group_id, - size: data.size, - status: data.status, - tags: data.tags, - updatedAt: unmarshalDate(data.updated_at), - upgradePolicy: data.upgrade_policy ? unmarshalPoolUpgradePolicy(data.upgrade_policy) : undefined, - version: data.version, - zone: data.zone, - } as Pool -} - const unmarshalACLRule = (data: unknown): ACLRule => { if (!isJSONObject(data)) { throw new TypeError( @@ -269,7 +288,9 @@ const unmarshalACLRule = (data: unknown): ACLRule => { } as ACLRule } -export const unmarshalAddClusterACLRulesResponse = (data: unknown): AddClusterACLRulesResponse => { +export const unmarshalAddClusterACLRulesResponse = ( + data: unknown, +): AddClusterACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddClusterACLRulesResponse' failed as data isn't a dictionary.`, @@ -281,7 +302,9 @@ export const unmarshalAddClusterACLRulesResponse = (data: unknown): AddClusterAC } as AddClusterACLRulesResponse } -const unmarshalExternalNodeCoreV1Taint = (data: unknown): ExternalNodeCoreV1Taint => { +const unmarshalExternalNodeCoreV1Taint = ( + data: unknown, +): ExternalNodeCoreV1Taint => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ExternalNodeCoreV1Taint' failed as data isn't a dictionary.`, @@ -314,7 +337,10 @@ export const unmarshalExternalNode = (data: unknown): ExternalNode => { kubeletConfig: data.kubelet_config, name: data.name, nodeLabels: data.node_labels, - nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalExternalNodeCoreV1Taint), + nodeTaints: unmarshalArrayOfObject( + data.node_taints, + unmarshalExternalNodeCoreV1Taint, + ), poolVersion: data.pool_version, runcVersion: data.runc_version, } as ExternalNode @@ -333,7 +359,9 @@ export const unmarshalExternalNodeAuth = (data: unknown): ExternalNodeAuth => { } as ExternalNodeAuth } -export const unmarshalListClusterACLRulesResponse = (data: unknown): ListClusterACLRulesResponse => { +export const unmarshalListClusterACLRulesResponse = ( + data: unknown, +): ListClusterACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClusterACLRulesResponse' failed as data isn't a dictionary.`, @@ -367,7 +395,9 @@ const unmarshalClusterType = (data: unknown): ClusterType => { } as ClusterType } -export const unmarshalListClusterAvailableTypesResponse = (data: unknown): ListClusterAvailableTypesResponse => { +export const unmarshalListClusterAvailableTypesResponse = ( + data: unknown, +): ListClusterAvailableTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClusterAvailableTypesResponse' failed as data isn't a dictionary.`, @@ -375,12 +405,17 @@ export const unmarshalListClusterAvailableTypesResponse = (data: unknown): ListC } return { - clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType), + clusterTypes: unmarshalArrayOfObject( + data.cluster_types, + unmarshalClusterType, + ), totalCount: data.total_count, } as ListClusterAvailableTypesResponse } -export const unmarshalListClusterAvailableVersionsResponse = (data: unknown): ListClusterAvailableVersionsResponse => { +export const unmarshalListClusterAvailableVersionsResponse = ( + data: unknown, +): ListClusterAvailableVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClusterAvailableVersionsResponse' failed as data isn't a dictionary.`, @@ -392,7 +427,9 @@ export const unmarshalListClusterAvailableVersionsResponse = (data: unknown): Li } as ListClusterAvailableVersionsResponse } -export const unmarshalListClusterTypesResponse = (data: unknown): ListClusterTypesResponse => { +export const unmarshalListClusterTypesResponse = ( + data: unknown, +): ListClusterTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClusterTypesResponse' failed as data isn't a dictionary.`, @@ -400,12 +437,17 @@ export const unmarshalListClusterTypesResponse = (data: unknown): ListClusterTyp } return { - clusterTypes: unmarshalArrayOfObject(data.cluster_types, unmarshalClusterType), + clusterTypes: unmarshalArrayOfObject( + data.cluster_types, + unmarshalClusterType, + ), totalCount: data.total_count, } as ListClusterTypesResponse } -export const unmarshalListClustersResponse = (data: unknown): ListClustersResponse => { +export const unmarshalListClustersResponse = ( + data: unknown, +): ListClustersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`, @@ -418,7 +460,9 @@ export const unmarshalListClustersResponse = (data: unknown): ListClustersRespon } as ListClustersResponse } -export const unmarshalListNodesResponse = (data: unknown): ListNodesResponse => { +export const unmarshalListNodesResponse = ( + data: unknown, +): ListNodesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodesResponse' failed as data isn't a dictionary.`, @@ -431,7 +475,9 @@ export const unmarshalListNodesResponse = (data: unknown): ListNodesResponse => } as ListNodesResponse } -export const unmarshalListPoolsResponse = (data: unknown): ListPoolsResponse => { +export const unmarshalListPoolsResponse = ( + data: unknown, +): ListPoolsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`, @@ -444,7 +490,9 @@ export const unmarshalListPoolsResponse = (data: unknown): ListPoolsResponse => } as ListPoolsResponse } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, @@ -456,7 +504,9 @@ export const unmarshalListVersionsResponse = (data: unknown): ListVersionsRespon } as ListVersionsResponse } -const unmarshalNodeMetadataCoreV1Taint = (data: unknown): NodeMetadataCoreV1Taint => { +const unmarshalNodeMetadataCoreV1Taint = ( + data: unknown, +): NodeMetadataCoreV1Taint => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'NodeMetadataCoreV1Taint' failed as data isn't a dictionary.`, @@ -488,7 +538,10 @@ export const unmarshalNodeMetadata = (data: unknown): NodeMetadata => { kubeletConfig: data.kubelet_config, name: data.name, nodeLabels: data.node_labels, - nodeTaints: unmarshalArrayOfObject(data.node_taints, unmarshalNodeMetadataCoreV1Taint), + nodeTaints: unmarshalArrayOfObject( + data.node_taints, + unmarshalNodeMetadataCoreV1Taint, + ), poolVersion: data.pool_version, providerId: data.provider_id, repoUri: data.repo_uri, @@ -500,7 +553,9 @@ export const unmarshalNodeMetadata = (data: unknown): NodeMetadata => { } as NodeMetadata } -export const unmarshalSetClusterACLRulesResponse = (data: unknown): SetClusterACLRulesResponse => { +export const unmarshalSetClusterACLRulesResponse = ( + data: unknown, +): SetClusterACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetClusterACLRulesResponse' failed as data isn't a dictionary.`, @@ -516,14 +571,10 @@ const marshalACLRuleRequest = ( request: ACLRuleRequest, defaults: DefaultValues, ): Record => ({ - description: request.description, + description: request.description, ...resolveOneOf([ - {param: 'ip', - value: request.ip, - }, - {param: 'scaleway_ranges', - value: request.scalewayRanges, - }, + { param: 'ip', value: request.ip }, + { param: 'scaleway_ranges', value: request.scalewayRanges }, ]), }) @@ -531,7 +582,10 @@ export const marshalAddClusterACLRulesRequest = ( request: AddClusterACLRulesRequest, defaults: DefaultValues, ): Record => ({ - acls: ((request.acls !== undefined) ? request.acls.map(elt => marshalACLRuleRequest(elt, defaults)): undefined), + acls: + request.acls !== undefined + ? request.acls.map(elt => marshalACLRuleRequest(elt, defaults)) + : undefined, }) const marshalMaintenanceWindow = ( @@ -555,7 +609,10 @@ const marshalCreateClusterRequestAutoUpgrade = ( defaults: DefaultValues, ): Record => ({ enable: request.enable, - maintenance_window: ((request.maintenanceWindow !== undefined) ? marshalMaintenanceWindow(request.maintenanceWindow, defaults): undefined), + maintenance_window: + request.maintenanceWindow !== undefined + ? marshalMaintenanceWindow(request.maintenanceWindow, defaults) + : undefined, }) const marshalCreateClusterRequestAutoscalerConfig = ( @@ -594,7 +651,7 @@ const marshalCreateClusterRequestPoolConfig = ( autohealing: request.autohealing, autoscaling: request.autoscaling, container_runtime: request.containerRuntime, - kubelet_args: request.kubeletArgs, + kubelet_args: request.kubeletArgs, max_size: request.maxSize, min_size: request.minSize, name: request.name, @@ -606,7 +663,13 @@ const marshalCreateClusterRequestPoolConfig = ( security_group_id: request.securityGroupId, size: request.size, tags: request.tags, - upgrade_policy: ((request.upgradePolicy !== undefined) ? marshalCreateClusterRequestPoolConfigUpgradePolicy(request.upgradePolicy, defaults): undefined), + upgrade_policy: + request.upgradePolicy !== undefined + ? marshalCreateClusterRequestPoolConfigUpgradePolicy( + request.upgradePolicy, + defaults, + ) + : undefined, zone: request.zone, }) @@ -616,26 +679,50 @@ export const marshalCreateClusterRequest = ( ): Record => ({ admission_plugins: request.admissionPlugins, apiserver_cert_sans: request.apiserverCertSans, - auto_upgrade: ((request.autoUpgrade !== undefined) ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade, defaults): undefined), - autoscaler_config: ((request.autoscalerConfig !== undefined) ? marshalCreateClusterRequestAutoscalerConfig(request.autoscalerConfig, defaults): undefined), + auto_upgrade: + request.autoUpgrade !== undefined + ? marshalCreateClusterRequestAutoUpgrade(request.autoUpgrade, defaults) + : undefined, + autoscaler_config: + request.autoscalerConfig !== undefined + ? marshalCreateClusterRequestAutoscalerConfig( + request.autoscalerConfig, + defaults, + ) + : undefined, cni: request.cni, description: request.description, feature_gates: request.featureGates, name: request.name || randomName('k8s'), - open_id_connect_config: ((request.openIdConnectConfig !== undefined) ? marshalCreateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig, defaults): undefined), + open_id_connect_config: + request.openIdConnectConfig !== undefined + ? marshalCreateClusterRequestOpenIDConnectConfig( + request.openIdConnectConfig, + defaults, + ) + : undefined, pod_cidr: request.podCidr, - pools: ((request.pools !== undefined) ? request.pools.map(elt => marshalCreateClusterRequestPoolConfig(elt, defaults)): undefined), + pools: + request.pools !== undefined + ? request.pools.map(elt => + marshalCreateClusterRequestPoolConfig(elt, defaults), + ) + : undefined, private_network_id: request.privateNetworkId, service_cidr: request.serviceCidr, service_dns_ip: request.serviceDnsIp, tags: request.tags, type: request.type, - version: request.version, + version: request.version, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -656,7 +743,8 @@ export const marshalCreatePoolRequest = ( autohealing: request.autohealing, autoscaling: request.autoscaling, container_runtime: request.containerRuntime, - kubelet_args: ((request.kubeletArgs !== undefined) ? request.kubeletArgs: undefined), + kubelet_args: + request.kubeletArgs !== undefined ? request.kubeletArgs : undefined, max_size: request.maxSize, min_size: request.minSize, name: request.name || randomName('pool'), @@ -668,7 +756,10 @@ export const marshalCreatePoolRequest = ( security_group_id: request.securityGroupId, size: request.size, tags: request.tags, - upgrade_policy: ((request.upgradePolicy !== undefined) ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy, defaults): undefined), + upgrade_policy: + request.upgradePolicy !== undefined + ? marshalCreatePoolRequestUpgradePolicy(request.upgradePolicy, defaults) + : undefined, zone: request.zone ?? defaults.defaultZone, }) @@ -683,7 +774,10 @@ export const marshalSetClusterACLRulesRequest = ( request: SetClusterACLRulesRequest, defaults: DefaultValues, ): Record => ({ - acls: ((request.acls !== undefined) ? request.acls.map(elt => marshalACLRuleRequest(elt, defaults)): undefined), + acls: + request.acls !== undefined + ? request.acls.map(elt => marshalACLRuleRequest(elt, defaults)) + : undefined, }) export const marshalSetClusterTypeRequest = ( @@ -698,7 +792,10 @@ const marshalUpdateClusterRequestAutoUpgrade = ( defaults: DefaultValues, ): Record => ({ enable: request.enable, - maintenance_window: ((request.maintenanceWindow !== undefined) ? marshalMaintenanceWindow(request.maintenanceWindow, defaults): undefined), + maintenance_window: + request.maintenanceWindow !== undefined + ? marshalMaintenanceWindow(request.maintenanceWindow, defaults) + : undefined, }) const marshalUpdateClusterRequestAutoscalerConfig = ( @@ -736,12 +833,27 @@ export const marshalUpdateClusterRequest = ( ): Record => ({ admission_plugins: request.admissionPlugins, apiserver_cert_sans: request.apiserverCertSans, - auto_upgrade: ((request.autoUpgrade !== undefined) ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade, defaults): undefined), - autoscaler_config: ((request.autoscalerConfig !== undefined) ? marshalUpdateClusterRequestAutoscalerConfig(request.autoscalerConfig, defaults): undefined), + auto_upgrade: + request.autoUpgrade !== undefined + ? marshalUpdateClusterRequestAutoUpgrade(request.autoUpgrade, defaults) + : undefined, + autoscaler_config: + request.autoscalerConfig !== undefined + ? marshalUpdateClusterRequestAutoscalerConfig( + request.autoscalerConfig, + defaults, + ) + : undefined, description: request.description, feature_gates: request.featureGates, name: request.name, - open_id_connect_config: ((request.openIdConnectConfig !== undefined) ? marshalUpdateClusterRequestOpenIDConnectConfig(request.openIdConnectConfig, defaults): undefined), + open_id_connect_config: + request.openIdConnectConfig !== undefined + ? marshalUpdateClusterRequestOpenIDConnectConfig( + request.openIdConnectConfig, + defaults, + ) + : undefined, tags: request.tags, }) @@ -764,7 +876,10 @@ export const marshalUpdatePoolRequest = ( min_size: request.minSize, size: request.size, tags: request.tags, - upgrade_policy: ((request.upgradePolicy !== undefined) ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy, defaults): undefined), + upgrade_policy: + request.upgradePolicy !== undefined + ? marshalUpdatePoolRequestUpgradePolicy(request.upgradePolicy, defaults) + : undefined, }) export const marshalUpgradeClusterRequest = ( diff --git a/packages_generated/k8s/src/v1/types.gen.ts b/packages_generated/k8s/src/v1/types.gen.ts index 953853c4c..fd3eb100d 100644 --- a/packages_generated/k8s/src/v1/types.gen.ts +++ b/packages_generated/k8s/src/v1/types.gen.ts @@ -1,11 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' - -export type AutoscalerEstimator = - | 'unknown_estimator' - | 'binpacking' +export type AutoscalerEstimator = 'unknown_estimator' | 'binpacking' export type AutoscalerExpander = | 'unknown_expander' @@ -35,10 +32,7 @@ export type ClusterStatus = | 'locked' | 'pool_required' -export type ClusterTypeAvailability = - | 'available' - | 'scarce' - | 'shortage' +export type ClusterTypeAvailability = 'available' | 'scarce' | 'shortage' export type ClusterTypeResiliency = | 'unknown_resiliency' @@ -122,11 +116,7 @@ export type PoolVolumeType = | 'sbs_5k' | 'sbs_15k' -export type Runtime = - | 'unknown_runtime' - | 'docker' - | 'containerd' - | 'crio' +export type Runtime = 'unknown_runtime' | 'docker' | 'containerd' | 'crio' export interface MaintenanceWindow { /** @@ -139,6 +129,10 @@ export interface MaintenanceWindow { day: MaintenanceWindowDayOfTheWeek } +export interface PoolUpgradePolicy { + maxUnavailable: number + maxSurge: number +} export interface CreateClusterRequestPoolConfigUpgradePolicy { /** @@ -151,7 +145,6 @@ export interface CreateClusterRequestPoolConfigUpgradePolicy { maxSurge?: number } - export interface ClusterAutoUpgrade { /** * Defines whether auto upgrade is enabled for the cluster. @@ -163,10 +156,9 @@ export interface ClusterAutoUpgrade { maintenanceWindow?: MaintenanceWindow } - export interface ClusterAutoscalerConfig { /** - * Forbid cluster autoscaler to scale down the cluster, defaults to false. + * Disable the cluster autoscaler. */ scaleDownDisabled: boolean /** @@ -178,15 +170,15 @@ export interface ClusterAutoscalerConfig { */ estimator: AutoscalerEstimator /** - * Kubernetes autoscaler strategy to fit pods into nodes, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders for details. + * Type of node group expander to be used in scale up. */ expander: AutoscalerExpander /** - * Ignore DaemonSet pods when calculating resource utilization for scaling down, defaults to false. + * Ignore DaemonSet pods when calculating resource utilization for scaling down. */ ignoreDaemonsetsUtilization: boolean /** - * Detect similar node groups and balance the number of nodes between them, defaults to false. + * Detect similar node groups and balance the number of nodes between them. */ balanceSimilarNodeGroups: boolean /** @@ -194,20 +186,19 @@ export interface ClusterAutoscalerConfig { */ expendablePodsPriorityCutoff: number /** - * How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes. + * How long a node should be unneeded before it is eligible to be scaled down. */ scaleDownUnneededTime: string /** - * Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down. + * Node utilization level, defined as a sum of requested resources divided by capacity, below which a node can be considered for scale down. */ scaleDownUtilizationThreshold: number /** - * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes). + * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. */ maxGracefulTerminationSec: number } - export interface ClusterOpenIDConnectConfig { /** * URL of the provider which allows the API server to discover public signing keys. Only URLs using the `https://` scheme are accepted. This is typically the provider's discovery URL without a path, for example "https://accounts.google.com" or "https://login.salesforce.com". @@ -239,13 +230,112 @@ export interface ClusterOpenIDConnectConfig { requiredClaim: string[] } - -export interface PoolUpgradePolicy { - maxUnavailable: number - maxSurge: number +export interface Pool { + /** + * Pool ID. + */ + id: string + /** + * Cluster ID of the pool. + */ + clusterId: string + /** + * Date on which the pool was created. + */ + createdAt?: Date + /** + * Date on which the pool was last updated. + */ + updatedAt?: Date + /** + * Pool name. + */ + name: string + /** + * Pool status. + */ + status: PoolStatus + /** + * Pool version. + */ + version: string + /** + * Node type is the type of Scaleway Instance wanted for the pool. Nodes with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST). 'external' is a special node type used to provision instances from other cloud providers in a Kosmos Cluster. + */ + nodeType: string + /** + * Defines whether the autoscaling feature is enabled for the pool. + */ + autoscaling: boolean + /** + * Size (number of nodes) of the pool. + */ + size: number + /** + * Defines the minimum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. + */ + minSize: number + /** + * Defines the maximum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. + */ + maxSize: number + /** + * Customization of the container runtime is available for each pool. + */ + containerRuntime: Runtime + /** + * Defines whether the autohealing feature is enabled for the pool. + */ + autohealing: boolean + /** + * Tags associated with the pool, see [managing tags](https://www.scaleway.com/en/docs/kubernetes/api-cli/managing-tags). + */ + tags: string[] + /** + * Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. + */ + placementGroupId?: string + /** + * Kubelet arguments to be used by this pool. Note that this feature is experimental. + */ + kubeletArgs: Record + /** + * Pool upgrade policy. + */ + upgradePolicy?: PoolUpgradePolicy + /** + * Zone in which the pool's nodes will be spawned. + */ + zone: ScwZone + /** + * * `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. This type is not available for all node types + * `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits + * `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits + * `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. + */ + rootVolumeType: PoolVolumeType + /** + * System volume disk size. + */ + rootVolumeSize?: number + /** + * Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway. + */ + publicIpDisabled: boolean + /** + * @deprecated Defines whether the pool is migrated to new images. + */ + newImagesEnabled?: boolean + /** + * Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone. + */ + securityGroupId: string + /** + * Cluster region of the pool. + */ + region: ScwRegion } - export interface ACLRuleRequest { /** * IP subnet to allow. @@ -265,7 +355,6 @@ export interface ACLRuleRequest { description: string } - export interface ACLRule { /** * ID of the ACL rule. @@ -289,7 +378,6 @@ export interface ACLRule { description: string } - export interface CreateClusterRequestAutoUpgrade { /** * Defines whether auto upgrade is enabled for the cluster. @@ -301,10 +389,9 @@ export interface CreateClusterRequestAutoUpgrade { maintenanceWindow?: MaintenanceWindow } - export interface CreateClusterRequestAutoscalerConfig { /** - * Forbid cluster autoscaler to scale down the cluster, defaults to false. + * Disable the cluster autoscaler. */ scaleDownDisabled?: boolean /** @@ -316,15 +403,15 @@ export interface CreateClusterRequestAutoscalerConfig { */ estimator: AutoscalerEstimator /** - * Kubernetes autoscaler strategy to fit pods into nodes, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders for details. + * Type of node group expander to be used in scale up. */ expander: AutoscalerExpander /** - * Ignore DaemonSet pods when calculating resource utilization for scaling down, defaults to false. + * Ignore DaemonSet pods when calculating resource utilization for scaling down. */ ignoreDaemonsetsUtilization?: boolean /** - * Detect similar node groups and balance the number of nodes between them, defaults to false. + * Detect similar node groups and balance the number of nodes between them. */ balanceSimilarNodeGroups?: boolean /** @@ -332,20 +419,19 @@ export interface CreateClusterRequestAutoscalerConfig { */ expendablePodsPriorityCutoff?: number /** - * How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes. + * How long a node should be unneeded before it is eligible to be scaled down. */ scaleDownUnneededTime?: string /** - * Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down. + * Node utilization level, defined as a sum of requested resources divided by capacity, below which a node can be considered for scale down. */ scaleDownUtilizationThreshold?: number /** - * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes). + * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. */ maxGracefulTerminationSec?: number } - export interface CreateClusterRequestOpenIDConnectConfig { /** * URL of the provider which allows the API server to discover public signing keys. Only URLs using the `https://` scheme are accepted. This is typically the provider's discovery URL without a path, for example "https://accounts.google.com" or "https://login.salesforce.com". @@ -377,7 +463,6 @@ export interface CreateClusterRequestOpenIDConnectConfig { requiredClaim?: string[] } - export interface CreateClusterRequestPoolConfig { /** * Name of the pool. @@ -433,9 +518,9 @@ export interface CreateClusterRequestPoolConfig { zone: ScwZone /** * * `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. This type is not available for all node types -* `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits -* `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits -* `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. + * `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits + * `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits + * `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. */ rootVolumeType: PoolVolumeType /** @@ -452,20 +537,17 @@ export interface CreateClusterRequestPoolConfig { securityGroupId?: string } - export interface CreatePoolRequestUpgradePolicy { maxUnavailable?: number maxSurge?: number } - export interface ExternalNodeCoreV1Taint { key: string value: string effect: string } - export interface ClusterType { /** * Cluster type name. @@ -509,7 +591,6 @@ export interface ClusterType { maxEtcdSize: number } - export interface Version { /** * Name of the Kubernetes version. @@ -557,7 +638,6 @@ export interface Version { releasedAt?: Date } - export interface Cluster { /** * Cluster ID. @@ -620,7 +700,7 @@ export interface Cluster { */ updatedAt?: Date /** - * Autoscaler configuration for the cluster, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md for details. + * Autoscaler config for the cluster. */ autoscalerConfig?: ClusterAutoscalerConfig /** @@ -681,7 +761,6 @@ export interface Cluster { serviceDnsIp: string } - export interface Node { /** * Node ID. @@ -737,121 +816,12 @@ export interface Node { updatedAt?: Date } - -export interface Pool { - /** - * Pool ID. - */ - id: string - /** - * Cluster ID of the pool. - */ - clusterId: string - /** - * Date on which the pool was created. - */ - createdAt?: Date - /** - * Date on which the pool was last updated. - */ - updatedAt?: Date - /** - * Pool name. - */ - name: string - /** - * Pool status. - */ - status: PoolStatus - /** - * Pool version. - */ - version: string - /** - * Node type is the type of Scaleway Instance wanted for the pool. Nodes with insufficient memory are not eligible (DEV1-S, PLAY2-PICO, STARDUST). 'external' is a special node type used to provision instances from other cloud providers in a Kosmos Cluster. - */ - nodeType: string - /** - * Defines whether the autoscaling feature is enabled for the pool. - */ - autoscaling: boolean - /** - * Size (number of nodes) of the pool. - */ - size: number - /** - * Defines the minimum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. - */ - minSize: number - /** - * Defines the maximum size of the pool. Note that this field is only used when autoscaling is enabled on the pool. - */ - maxSize: number - /** - * Customization of the container runtime is available for each pool. - */ - containerRuntime: Runtime - /** - * Defines whether the autohealing feature is enabled for the pool. - */ - autohealing: boolean - /** - * Tags associated with the pool, see [managing tags](https://www.scaleway.com/en/docs/kubernetes/api-cli/managing-tags). - */ - tags: string[] - /** - * Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. - */ - placementGroupId?: string - /** - * Kubelet arguments to be used by this pool. Note that this feature is experimental. - */ - kubeletArgs: Record - /** - * Pool upgrade policy. - */ - upgradePolicy?: PoolUpgradePolicy - /** - * Zone in which the pool's nodes will be spawned. - */ - zone: ScwZone - /** - * * `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. This type is not available for all node types -* `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits -* `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits -* `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. - */ - rootVolumeType: PoolVolumeType - /** - * System volume disk size. - */ - rootVolumeSize?: number - /** - * Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway. - */ - publicIpDisabled: boolean - /** - * @deprecated Defines whether the pool is migrated to new images. - */ - newImagesEnabled?: boolean - /** - * Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone. - */ - securityGroupId: string - /** - * Cluster region of the pool. - */ - region: ScwRegion -} - - export interface NodeMetadataCoreV1Taint { key: string value: string effect: string } - export interface UpdateClusterRequestAutoUpgrade { /** * Defines whether auto upgrade is enabled for the cluster. @@ -863,10 +833,9 @@ export interface UpdateClusterRequestAutoUpgrade { maintenanceWindow?: MaintenanceWindow } - export interface UpdateClusterRequestAutoscalerConfig { /** - * Forbid cluster autoscaler to scale down the cluster, defaults to false. + * Disable the cluster autoscaler. */ scaleDownDisabled?: boolean /** @@ -878,15 +847,15 @@ export interface UpdateClusterRequestAutoscalerConfig { */ estimator: AutoscalerEstimator /** - * Kubernetes autoscaler strategy to fit pods into nodes, see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-are-expanders for details. + * Type of node group expander to be used in scale up. */ expander: AutoscalerExpander /** - * Ignore DaemonSet pods when calculating resource utilization for scaling down, defaults to false. + * Ignore DaemonSet pods when calculating resource utilization for scaling down. */ ignoreDaemonsetsUtilization?: boolean /** - * Detect similar node groups and balance the number of nodes between them, defaults to false. + * Detect similar node groups and balance the number of nodes between them. */ balanceSimilarNodeGroups?: boolean /** @@ -894,20 +863,19 @@ export interface UpdateClusterRequestAutoscalerConfig { */ expendablePodsPriorityCutoff?: number /** - * How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes. + * How long a node should be unneeded before it is eligible to be scaled down. */ scaleDownUnneededTime?: string /** - * Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down. + * Node utilization level, defined as a sum of requested resources divided by capacity, below which a node can be considered for scale down. */ scaleDownUtilizationThreshold?: number /** - * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes). + * Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node. */ maxGracefulTerminationSec?: number } - export interface UpdateClusterRequestOpenIDConnectConfig { /** * URL of the provider which allows the API server to discover public signing keys. Only URLs using the `https://` scheme are accepted. This is typically the provider's discovery URL without a path, for example "https://accounts.google.com" or "https://login.salesforce.com". @@ -939,13 +907,11 @@ export interface UpdateClusterRequestOpenIDConnectConfig { requiredClaim?: string[] } - export interface UpdatePoolRequestUpgradePolicy { maxUnavailable?: number maxSurge?: number } - export type AddClusterACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -961,7 +927,6 @@ export type AddClusterACLRulesRequest = { acls?: ACLRuleRequest[] } - export interface AddClusterACLRulesResponse { /** * ACLs that were added. @@ -969,7 +934,6 @@ export interface AddClusterACLRulesResponse { rules: ACLRule[] } - export type AuthExternalNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -981,7 +945,6 @@ export type AuthExternalNodeRequest = { poolId: string } - export type CreateClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1069,7 +1032,6 @@ export type CreateClusterRequest = { serviceDnsIp?: string } - export type CreateExternalNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1078,7 +1040,6 @@ export type CreateExternalNodeRequest = { poolId: string } - export type CreatePoolRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1142,9 +1103,9 @@ export type CreatePoolRequest = { zone?: ScwZone /** * * `l_ssd` is a local block storage which means your system is stored locally on your node's hypervisor. This type is not available for all node types -* `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits -* `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits -* `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. + * `sbs-5k` is a remote block storage which means your system is stored on a centralized and resilient cluster with 5k IOPS limits + * `sbs-15k` is a faster remote block storage which means your system is stored on a centralized and resilient cluster with 15k IOPS limits + * `b_ssd` is the legacy remote block storage which means your system is stored on a centralized and resilient cluster. Consider using `sbs-5k` or `sbs-15k` instead. */ rootVolumeType?: PoolVolumeType /** @@ -1161,7 +1122,6 @@ export type CreatePoolRequest = { securityGroupId?: string } - export type DeleteACLRuleRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1173,7 +1133,6 @@ export type DeleteACLRuleRequest = { aclId: string } - export type DeleteClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1189,7 +1148,6 @@ export type DeleteClusterRequest = { withAdditionalResources: boolean } - export type DeleteNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1209,7 +1167,6 @@ export type DeleteNodeRequest = { replace: boolean } - export type DeletePoolRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1221,7 +1178,6 @@ export type DeletePoolRequest = { poolId: string } - export interface ExternalNode { id: string name: string @@ -1239,13 +1195,11 @@ export interface ExternalNode { iamToken: string } - export interface ExternalNodeAuth { nodeSecretKey: string metadataUrl: string } - export type GetClusterKubeConfigRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1261,7 +1215,6 @@ export type GetClusterKubeConfigRequest = { redacted?: boolean } - export type GetClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1273,7 +1226,6 @@ export type GetClusterRequest = { clusterId: string } - export type GetNodeMetadataRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1281,7 +1233,6 @@ export type GetNodeMetadataRequest = { region?: ScwRegion } - export type GetNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1293,7 +1244,6 @@ export type GetNodeRequest = { nodeId: string } - export type GetPoolRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1305,7 +1255,6 @@ export type GetPoolRequest = { poolId: string } - export type GetVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1317,7 +1266,6 @@ export type GetVersionRequest = { versionName: string } - export type ListClusterACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1337,7 +1285,6 @@ export type ListClusterACLRulesRequest = { pageSize?: number } - export interface ListClusterACLRulesResponse { /** * Total number of ACLs that exist for the cluster. @@ -1349,7 +1296,6 @@ export interface ListClusterACLRulesResponse { rules: ACLRule[] } - export type ListClusterAvailableTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1361,7 +1307,6 @@ export type ListClusterAvailableTypesRequest = { clusterId: string } - export interface ListClusterAvailableTypesResponse { /** * Available cluster types for the cluster. @@ -1373,7 +1318,6 @@ export interface ListClusterAvailableTypesResponse { totalCount: number } - export type ListClusterAvailableVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1385,7 +1329,6 @@ export type ListClusterAvailableVersionsRequest = { clusterId: string } - export interface ListClusterAvailableVersionsResponse { /** * Available Kubernetes versions for the cluster. @@ -1393,7 +1336,6 @@ export interface ListClusterAvailableVersionsResponse { versions: Version[] } - export type ListClusterTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1409,7 +1351,6 @@ export type ListClusterTypesRequest = { pageSize?: number } - export interface ListClusterTypesResponse { /** * Total number of cluster-types. @@ -1421,7 +1362,6 @@ export interface ListClusterTypesResponse { clusterTypes: ClusterType[] } - export type ListClustersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1465,7 +1405,6 @@ export type ListClustersRequest = { privateNetworkId?: string } - export interface ListClustersResponse { /** * Total number of clusters. @@ -1477,7 +1416,6 @@ export interface ListClustersResponse { clusters: Cluster[] } - export type ListNodesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1513,7 +1451,6 @@ export type ListNodesRequest = { status?: NodeStatus } - export interface ListNodesResponse { /** * Total number of nodes. @@ -1525,7 +1462,6 @@ export interface ListNodesResponse { nodes: Node[] } - export type ListPoolsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1557,7 +1493,6 @@ export type ListPoolsRequest = { status?: PoolStatus } - export interface ListPoolsResponse { /** * Total number of pools that exists for the cluster. @@ -1569,7 +1504,6 @@ export interface ListPoolsResponse { pools: Pool[] } - export type ListVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1577,7 +1511,6 @@ export type ListVersionsRequest = { region?: ScwRegion } - export interface ListVersionsResponse { /** * Available Kubernetes versions. @@ -1585,7 +1518,6 @@ export interface ListVersionsResponse { versions: Version[] } - export type MigratePoolsToNewImagesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1595,7 +1527,6 @@ export type MigratePoolsToNewImagesRequest = { poolIds?: string[] } - export interface NodeMetadata { id: string name: string @@ -1618,7 +1549,6 @@ export interface NodeMetadata { updaterBinPath: string } - export type RebootNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1630,7 +1560,6 @@ export type RebootNodeRequest = { nodeId: string } - export type ReplaceNodeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1642,7 +1571,6 @@ export type ReplaceNodeRequest = { nodeId: string } - export type ResetClusterAdminTokenRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1654,7 +1582,6 @@ export type ResetClusterAdminTokenRequest = { clusterId: string } - export type SetClusterACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1670,7 +1597,6 @@ export type SetClusterACLRulesRequest = { acls?: ACLRuleRequest[] } - export interface SetClusterACLRulesResponse { /** * ACLs that were set. @@ -1678,7 +1604,6 @@ export interface SetClusterACLRulesResponse { rules: ACLRule[] } - export type SetClusterTypeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1694,7 +1619,6 @@ export type SetClusterTypeRequest = { type: string } - export type UpdateClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1742,7 +1666,6 @@ export type UpdateClusterRequest = { apiserverCertSans?: string[] } - export type UpdatePoolRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1786,7 +1709,6 @@ export type UpdatePoolRequest = { upgradePolicy?: UpdatePoolRequestUpgradePolicy } - export type UpgradeClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1806,7 +1728,6 @@ export type UpgradeClusterRequest = { upgradePools: boolean } - export type UpgradePoolRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1821,5 +1742,3 @@ export type UpgradePoolRequest = { */ version: string } - - diff --git a/packages_generated/kafka/src/v1alpha1/api.gen.ts b/packages_generated/kafka/src/v1alpha1/api.gen.ts index 033f2d25c..5cd13c068 100644 --- a/packages_generated/kafka/src/v1alpha1/api.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_KAFKA,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_KAFKA } from './content.gen.js' import { unmarshalCluster, marshalCreateClusterRequest, @@ -60,14 +60,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - - protected pageOfListNodeTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + + protected pageOfListNodeTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -75,12 +74,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['include_disabled_types', request.includeDisabledTypes], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. * @@ -90,21 +92,25 @@ export class API extends ParentAPI { listNodeTypes = (request: Readonly = {}) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - protected pageOfListVersions = (request: Readonly = {}) => + protected pageOfListVersions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListVersionsResponse, ) - + /** * List Kafka versions. List all available versions of Kafka at the current time. * @@ -114,8 +120,9 @@ export class API extends ParentAPI { listVersions = (request: Readonly = {}) => enrichForPagination('versions', this.pageOfListVersions, request) - - protected pageOfListClusters = (request: Readonly = {}) => + protected pageOfListClusters = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -125,14 +132,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListClustersResponse, ) - + /** * List Kafka clusters. List all Kafka clusters in the specified region. By default, the clusters returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -142,7 +152,6 @@ export class API extends ParentAPI { listClusters = (request: Readonly = {}) => enrichForPagination('clusters', this.pageOfListClusters, request) - /** * Get a Kafka cluster. Retrieve information about a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object. * @@ -157,7 +166,7 @@ export class API extends ParentAPI { }, unmarshalCluster, ) - + /** * Waits for {@link Cluster} to be in a final state. * @@ -170,13 +179,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES_KAFKA.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CLUSTER_TRANSIENT_STATUSES_KAFKA.includes(res.status), + )), this.getCluster, request, options, ) - /** * Create a Kafka cluster. Create a new Kafka cluster. * @@ -196,7 +208,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Update a Kafka cluster. Update the parameters of a Kafka cluster. * @@ -216,7 +227,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Delete a Kafka cluster. Delete a given Kafka cluster, specified by the `region` and `cluster_id` parameters. Deleting a Kafka cluster is permanent, and cannot be undone. Note that upon deletion all your data will be lost. * @@ -232,56 +242,48 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get a Kafka cluster's certificate authority. Retrieve certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The response object contains the certificate in PEM format. The certificate is required to validate the sever from the client side during TLS connection. * * @param request - The request {@link GetClusterCertificateAuthorityRequest} * @returns A Promise of Blob */ - getClusterCertificateAuthority = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate-authority`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + getClusterCertificateAuthority = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'GET', + path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate-authority`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Renew the Kafka cluster's certificate authority. Request to renew the certificate authority for a given Kafka cluster, specified by the `region` and `cluster_id` parameters. The certificate authority will be renewed within a few minutes. * * @param request - The request {@link RenewClusterCertificateAuthorityRequest} */ - renewClusterCertificateAuthority = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate-authority`, - }, - ) + renewClusterCertificateAuthority = ( + request: Readonly, + ) => + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/clusters/${validatePathParam('clusterId', request.clusterId)}/renew-certificate-authority`, + }) - /** * Delete a Kafka cluster endpoint. Delete the endpoint of a Kafka cluster. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/kafka/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - /** * Create a new Kafka cluster endpoint. Create a new endpoint for a Kafka cluster. You can add `public_network` or `private_network` specifications to the body of the request. Note that currently only `private_network` is supported. * @@ -301,7 +303,6 @@ export class API extends ParentAPI { unmarshalEndpoint, ) - protected pageOfListUsers = (request: Readonly) => this.client.fetch( { @@ -311,12 +312,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListUsersResponse, ) - + /** * Retrieve a list of deployment users. * @@ -326,7 +330,6 @@ export class API extends ParentAPI { listUsers = (request: Readonly) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Update an existing user. * @@ -345,7 +348,4 @@ export class API extends ParentAPI { }, unmarshalUser, ) - - } - diff --git a/packages_generated/kafka/src/v1alpha1/content.gen.ts b/packages_generated/kafka/src/v1alpha1/content.gen.ts index b4b7df05e..aa5f49b5a 100644 --- a/packages_generated/kafka/src/v1alpha1/content.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - ClusterStatus, -} from './types.gen.js' - +import type { ClusterStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link ClusterStatus}. */ export const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[] = [ @@ -11,4 +8,3 @@ export const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[] = [ 'configuring', 'deleting', ] - diff --git a/packages_generated/kafka/src/v1alpha1/index.gen.ts b/packages_generated/kafka/src/v1alpha1/index.gen.ts index 2aeff363d..f74f1c735 100644 --- a/packages_generated/kafka/src/v1alpha1/index.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/kafka/src/v1alpha1/marshalling.gen.ts b/packages_generated/kafka/src/v1alpha1/marshalling.gen.ts index b01d50e16..d7cd01704 100644 --- a/packages_generated/kafka/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointPrivateNetworkDetails, @@ -33,7 +38,9 @@ import type { UpdateUserRequest, } from './types.gen.js' -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -45,15 +52,16 @@ const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateN } as EndpointPrivateNetworkDetails } -const unmarshalEndpointPublicDetails = (data: unknown): EndpointPublicDetails => { +const unmarshalEndpointPublicDetails = ( + data: unknown, +): EndpointPublicDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointPublicDetails + return {} as EndpointPublicDetails } export const unmarshalEndpoint = (data: unknown): Endpoint => { @@ -67,8 +75,12 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { dnsRecords: data.dns_records, id: data.id, port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, - publicNetwork: data.public_network ? unmarshalEndpointPublicDetails(data.public_network) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, + publicNetwork: data.public_network + ? unmarshalEndpointPublicDetails(data.public_network) + : undefined, } as Endpoint } @@ -139,7 +151,9 @@ export const unmarshalUser = (data: unknown): User => { } as User } -export const unmarshalListClustersResponse = (data: unknown): ListClustersResponse => { +export const unmarshalListClustersResponse = ( + data: unknown, +): ListClustersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`, @@ -176,7 +190,10 @@ const unmarshalNodeType = (data: unknown): NodeType => { } return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType), + availableVolumeTypes: unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType, + ), beta: data.beta, clusterRange: data.cluster_range, description: data.description, @@ -188,7 +205,9 @@ const unmarshalNodeType = (data: unknown): NodeType => { } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -201,7 +220,9 @@ export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResp } as ListNodeTypesResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -214,7 +235,9 @@ export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => } as ListUsersResponse } -const unmarshalVersionAvailableSettingBooleanProperty = (data: unknown): VersionAvailableSettingBooleanProperty => { +const unmarshalVersionAvailableSettingBooleanProperty = ( + data: unknown, +): VersionAvailableSettingBooleanProperty => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VersionAvailableSettingBooleanProperty' failed as data isn't a dictionary.`, @@ -226,7 +249,9 @@ const unmarshalVersionAvailableSettingBooleanProperty = (data: unknown): Version } as VersionAvailableSettingBooleanProperty } -const unmarshalVersionAvailableSettingFloatProperty = (data: unknown): VersionAvailableSettingFloatProperty => { +const unmarshalVersionAvailableSettingFloatProperty = ( + data: unknown, +): VersionAvailableSettingFloatProperty => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VersionAvailableSettingFloatProperty' failed as data isn't a dictionary.`, @@ -241,7 +266,9 @@ const unmarshalVersionAvailableSettingFloatProperty = (data: unknown): VersionAv } as VersionAvailableSettingFloatProperty } -const unmarshalVersionAvailableSettingIntegerProperty = (data: unknown): VersionAvailableSettingIntegerProperty => { +const unmarshalVersionAvailableSettingIntegerProperty = ( + data: unknown, +): VersionAvailableSettingIntegerProperty => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VersionAvailableSettingIntegerProperty' failed as data isn't a dictionary.`, @@ -256,7 +283,9 @@ const unmarshalVersionAvailableSettingIntegerProperty = (data: unknown): Version } as VersionAvailableSettingIntegerProperty } -const unmarshalVersionAvailableSettingStringProperty = (data: unknown): VersionAvailableSettingStringProperty => { +const unmarshalVersionAvailableSettingStringProperty = ( + data: unknown, +): VersionAvailableSettingStringProperty => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VersionAvailableSettingStringProperty' failed as data isn't a dictionary.`, @@ -269,7 +298,9 @@ const unmarshalVersionAvailableSettingStringProperty = (data: unknown): VersionA } as VersionAvailableSettingStringProperty } -const unmarshalVersionAvailableSetting = (data: unknown): VersionAvailableSetting => { +const unmarshalVersionAvailableSetting = ( + data: unknown, +): VersionAvailableSetting => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VersionAvailableSetting' failed as data isn't a dictionary.`, @@ -277,13 +308,21 @@ const unmarshalVersionAvailableSetting = (data: unknown): VersionAvailableSettin } return { - boolProperty: data.bool_property ? unmarshalVersionAvailableSettingBooleanProperty(data.bool_property) : undefined, + boolProperty: data.bool_property + ? unmarshalVersionAvailableSettingBooleanProperty(data.bool_property) + : undefined, description: data.description, - floatProperty: data.float_property ? unmarshalVersionAvailableSettingFloatProperty(data.float_property) : undefined, + floatProperty: data.float_property + ? unmarshalVersionAvailableSettingFloatProperty(data.float_property) + : undefined, hotConfigurable: data.hot_configurable, - intProperty: data.int_property ? unmarshalVersionAvailableSettingIntegerProperty(data.int_property) : undefined, + intProperty: data.int_property + ? unmarshalVersionAvailableSettingIntegerProperty(data.int_property) + : undefined, name: data.name, - stringProperty: data.string_property ? unmarshalVersionAvailableSettingStringProperty(data.string_property) : undefined, + stringProperty: data.string_property + ? unmarshalVersionAvailableSettingStringProperty(data.string_property) + : undefined, } as VersionAvailableSetting } @@ -295,13 +334,18 @@ const unmarshalVersion = (data: unknown): Version => { } return { - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalVersionAvailableSetting), + availableSettings: unmarshalArrayOfObject( + data.available_settings, + unmarshalVersionAvailableSetting, + ), endOfLifeAt: unmarshalDate(data.end_of_life_at), version: data.version, } as Version } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, @@ -324,8 +368,7 @@ const marshalEndpointSpecPrivateNetworkDetails = ( const marshalEndpointSpecPublicDetails = ( request: EndpointSpecPublicDetails, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalCreateClusterRequestVolumeSpec = ( request: CreateClusterRequestVolumeSpec, @@ -338,15 +381,24 @@ const marshalCreateClusterRequestVolumeSpec = ( const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'public_network', - value: (request.publicNetwork !== undefined) ? marshalEndpointSpecPublicDetails(request.publicNetwork, defaults) - : undefined, + { + param: 'public_network', + value: + request.publicNetwork !== undefined + ? marshalEndpointSpecPublicDetails(request.publicNetwork, defaults) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkDetails( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -355,7 +407,10 @@ export const marshalCreateClusterRequest = ( request: CreateClusterRequest, defaults: DefaultValues, ): Record => ({ - endpoints: ((request.endpoints !== undefined) ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), + endpoints: + request.endpoints !== undefined + ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, name: request.name || randomName('kafk'), node_amount: request.nodeAmount, node_type: request.nodeType, @@ -364,7 +419,10 @@ export const marshalCreateClusterRequest = ( tags: request.tags, user_name: request.userName, version: request.version, - volume: ((request.volume !== undefined) ? marshalCreateClusterRequestVolumeSpec(request.volume, defaults): undefined), + volume: + request.volume !== undefined + ? marshalCreateClusterRequestVolumeSpec(request.volume, defaults) + : undefined, }) export const marshalCreateEndpointRequest = ( @@ -372,7 +430,7 @@ export const marshalCreateEndpointRequest = ( defaults: DefaultValues, ): Record => ({ cluster_id: request.clusterId, - endpoint: marshalEndpointSpec(request.endpoint, defaults), + endpoint: marshalEndpointSpec(request.endpoint, defaults), }) export const marshalUpdateClusterRequest = ( diff --git a/packages_generated/kafka/src/v1alpha1/types.gen.ts b/packages_generated/kafka/src/v1alpha1/types.gen.ts index 3af2cfad8..509ecc385 100644 --- a/packages_generated/kafka/src/v1alpha1/types.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type ClusterStatus = | 'unknown_status' @@ -21,9 +20,7 @@ export type ListClustersRequestOrderBy = | 'status_asc' | 'status_desc' -export type ListUsersRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListUsersRequestOrderBy = 'name_asc' | 'name_desc' export type NodeTypeStock = | 'unknown_stock' @@ -31,10 +28,7 @@ export type NodeTypeStock = | 'out_of_stock' | 'available' -export type VolumeType = - | 'unknown_type' - | 'sbs_5k' - | 'sbs_15k' +export type VolumeType = 'unknown_type' | 'sbs_5k' | 'sbs_15k' /** * Private Network details. @@ -46,19 +40,15 @@ export interface EndpointPrivateNetworkDetails { privateNetworkId: string } - /** * Public Access details. */ -export interface EndpointPublicDetails { -} - +export interface EndpointPublicDetails {} export interface VersionAvailableSettingBooleanProperty { defaultValue: boolean } - export interface VersionAvailableSettingFloatProperty { min: number max: number @@ -66,7 +56,6 @@ export interface VersionAvailableSettingFloatProperty { unit?: string } - export interface VersionAvailableSettingIntegerProperty { min: number max: number @@ -74,13 +63,11 @@ export interface VersionAvailableSettingIntegerProperty { unit?: string } - export interface VersionAvailableSettingStringProperty { stringConstraint?: string defaultValue: string } - export interface EndpointSpecPrivateNetworkDetails { /** * UUID of the Private Network. @@ -88,10 +75,7 @@ export interface EndpointSpecPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointSpecPublicDetails { -} - +export interface EndpointSpecPublicDetails {} export interface ClusterSetting { /** @@ -124,7 +108,6 @@ export interface ClusterSetting { floatValue?: number } - export interface Endpoint { /** * UUID of the endpoint. @@ -152,7 +135,6 @@ export interface Endpoint { publicNetwork?: EndpointPublicDetails } - export interface Volume { /** * Type of volume where data is stored. @@ -164,7 +146,6 @@ export interface Volume { sizeBytes: number } - export interface NodeTypeVolumeType { /** * Volume type. @@ -188,7 +169,6 @@ export interface NodeTypeVolumeType { chunkSizeBytes: number } - export interface VersionAvailableSetting { /** * Kafka cluster setting name. @@ -228,7 +208,6 @@ export interface VersionAvailableSetting { floatProperty?: VersionAvailableSettingFloatProperty } - export interface CreateClusterRequestVolumeSpec { /** * Volume size. @@ -240,7 +219,6 @@ export interface CreateClusterRequestVolumeSpec { type: VolumeType } - export interface EndpointSpec { /** * @@ -254,7 +232,6 @@ export interface EndpointSpec { privateNetwork?: EndpointSpecPrivateNetworkDetails } - export interface Cluster { /** * UUID of the Kafka cluster. @@ -318,7 +295,6 @@ export interface Cluster { region: ScwRegion } - export interface NodeType { /** * Node type name identifier. @@ -358,12 +334,10 @@ export interface NodeType { clusterRange: string } - export interface User { username: string } - export interface Version { /** * Kafka version. @@ -379,7 +353,6 @@ export interface Version { availableSettings: VersionAvailableSetting[] } - export type CreateClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -427,7 +400,6 @@ export type CreateClusterRequest = { password?: string } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -443,7 +415,6 @@ export type CreateEndpointRequest = { endpoint: EndpointSpec } - export type DeleteClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -455,7 +426,6 @@ export type DeleteClusterRequest = { clusterId: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -467,7 +437,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type GetClusterCertificateAuthorityRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -479,7 +448,6 @@ export type GetClusterCertificateAuthorityRequest = { clusterId: string } - export type GetClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -491,7 +459,6 @@ export type GetClusterRequest = { clusterId: string } - export type ListClustersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -521,7 +488,6 @@ export type ListClustersRequest = { pageSize?: number } - export interface ListClustersResponse { /** * List of all Kafka cluster available in an Organization or Project. @@ -533,7 +499,6 @@ export interface ListClustersResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -547,7 +512,6 @@ export type ListNodeTypesRequest = { pageSize?: number } - export interface ListNodeTypesResponse { /** * Types of the node. @@ -559,7 +523,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type ListUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -572,13 +535,11 @@ export type ListUsersRequest = { name?: string } - export interface ListUsersResponse { users: User[] totalCount: number } - export type ListVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -598,7 +559,6 @@ export type ListVersionsRequest = { pageSize?: number } - export interface ListVersionsResponse { /** * Available Kafka versions. @@ -610,7 +570,6 @@ export interface ListVersionsResponse { totalCount: number } - export type RenewClusterCertificateAuthorityRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -622,7 +581,6 @@ export type RenewClusterCertificateAuthorityRequest = { clusterId: string } - export type UpdateClusterRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -642,7 +600,6 @@ export type UpdateClusterRequest = { tags?: string[] } - /** * Update a user of a Kafka cluster. */ @@ -664,5 +621,3 @@ export type UpdateUserRequest = { */ password?: string } - - diff --git a/packages_generated/kafka/src/v1alpha1/validation-rules.gen.ts b/packages_generated/kafka/src/v1alpha1/validation-rules.gen.ts index cd0fdcd96..bf9000251 100644 --- a/packages_generated/kafka/src/v1alpha1/validation-rules.gen.ts +++ b/packages_generated/kafka/src/v1alpha1/validation-rules.gen.ts @@ -23,7 +23,8 @@ export const CreateClusterRequest = { userName: { maxLength: 63, minLength: 1, - pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, + pattern: + /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, }, version: { pattern: /^[0-9]+\.[0-9]+\.[0-9]+$/, @@ -59,7 +60,8 @@ export const ListUsersRequest = { name: { maxLength: 63, minLength: 1, - pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, + pattern: + /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, }, page: { greaterThanOrEqual: 1, @@ -99,6 +101,7 @@ export const UpdateUserRequest = { username: { maxLength: 63, minLength: 1, - pattern: /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, + pattern: + /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/, }, } diff --git a/packages_generated/key_manager/src/v1alpha1/api.gen.ts b/packages_generated/key_manager/src/v1alpha1/api.gen.ts index 5d7cd6a13..872ba3145 100644 --- a/packages_generated/key_manager/src/v1alpha1/api.gen.ts +++ b/packages_generated/key_manager/src/v1alpha1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalCreateKeyRequest, unmarshalDataKey, @@ -73,15 +73,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Create a key. Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**. * @@ -101,7 +96,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Get key metadata. Retrieve metadata for a specified key using the `region` and `key_id` parameters. * @@ -117,7 +111,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Get the public key in PEM format.. Retrieves the public portion of an asymmetric cryptographic key in PEM format. * @@ -133,7 +126,6 @@ export class API extends ParentAPI { unmarshalPublicKey, ) - /** * Update a key. Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters. * @@ -153,21 +145,17 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Delete a key. Permanently delete a key specified by the `region` and `key_id` parameters. This action is irreversible. Any data encrypted with this key, including data encryption keys, will no longer be decipherable. * * @param request - The request {@link DeleteKeyRequest} */ deleteKey = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}`, + }) - /** * Rotate a key. Generate a new version of an existing key with new key material. Previous key versions remain usable to decrypt previously encrypted data, but the key's new version will be used for subsequent encryption operations and data key generation. * @@ -185,7 +173,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Apply key protection. Apply protection to a given key specified by the `key_id` parameter. Applying key protection means that your key can be used and modified, but it cannot be deleted. * @@ -203,7 +190,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Remove key protection. Remove key protection from a given key specified by the `key_id` parameter. Removing key protection means that your key can be deleted anytime. * @@ -221,7 +207,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Enable key. Enable a given key to be used for cryptographic operations. Enabling a key allows you to make a disabled key usable again. You must specify the `region` and `key_id` parameters. * @@ -239,7 +224,6 @@ export class API extends ParentAPI { unmarshalKey, ) - /** * Disable key. Disable a given key, preventing it to be used for cryptographic operations. Disabling a key renders it unusable. You must specify the `region` and `key_id` parameters. * @@ -257,7 +241,6 @@ export class API extends ParentAPI { unmarshalKey, ) - protected pageOfListKeys = (request: Readonly) => this.client.fetch( { @@ -268,7 +251,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['scheduled_for_deletion', request.scheduledForDeletion], ['tags', request.tags], @@ -277,7 +263,7 @@ export class API extends ParentAPI { }, unmarshalListKeysResponse, ) - + /** * List keys. Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`. * @@ -287,7 +273,6 @@ export class API extends ParentAPI { listKeys = (request: Readonly) => enrichForPagination('keys', this.pageOfListKeys, request) - /** * Create a data encryption key. Create a new data encryption key for cryptographic operations outside of Key Manager. The data encryption key is encrypted and must be decrypted using the key you have created in Key Manager. @@ -309,7 +294,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalDataKey, ) - /** * Encrypt a payload. Encrypt a payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be encrypted is 64 KB of plaintext. * @@ -329,7 +313,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalEncryptResponse, ) - /** * Decrypt an encrypted payload. Decrypt an encrypted payload using an existing key, specified by the `key_id` parameter. The maximum payload size that can be decrypted is equivalent to the encrypted output of 64 KB of data (around 131 KB). * @@ -349,7 +332,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalDecryptResponse, ) - /** * Sign a message digest. Use a given key to sign a message digest. The key must have its usage set to `asymmetric_signing`. The digest must be created using the same digest algorithm that is defined in the key's algorithm configuration. * @@ -359,9 +341,7 @@ The data encryption key is returned in plaintext and ciphertext but it should on sign = (request: Readonly) => this.client.fetch( { - body: JSON.stringify( - marshalSignRequest(request, this.client.settings), - ), + body: JSON.stringify(marshalSignRequest(request, this.client.settings)), headers: jsonContentHeaders, method: 'POST', path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}/sign`, @@ -369,7 +349,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalSignResponse, ) - /** * Verify a message signature. Use a given key to verify a message signature against a message digest. The key must have its usage set to `asymmetric_signing`. The message digest must be generated using the same digest algorithm that is defined in the key's algorithm configuration. * @@ -389,7 +368,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalVerifyResponse, ) - /** * Import key material. Import externally generated key material into Key Manager to derive a new cryptographic key. The key's origin must be `external`. * @@ -409,23 +387,19 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalKey, ) - /** * Delete key material. Delete previously imported key material. This renders the associated cryptographic key unusable for any operation. The key's origin must be `external`. * * @param request - The request {@link DeleteKeyMaterialRequest} */ deleteKeyMaterial = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}/delete-key-material`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}/delete-key-material`, + }) - /** * Restore a key. Restore a key and all its rotations scheduled for deletion specified by the `region` and `key_id` parameters. * @@ -443,7 +417,6 @@ The data encryption key is returned in plaintext and ciphertext but it should on unmarshalKey, ) - /** * List all available algorithms. Lists all cryptographic algorithms supported by the Key Manager service. * @@ -455,13 +428,8 @@ The data encryption key is returned in plaintext and ciphertext but it should on { method: 'GET', path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/algorithms`, - urlParams: urlParams( - ['usages', request.usages], - ), + urlParams: urlParams(['usages', request.usages]), }, unmarshalListAlgorithmsResponse, ) - - } - diff --git a/packages_generated/key_manager/src/v1alpha1/index.gen.ts b/packages_generated/key_manager/src/v1alpha1/index.gen.ts index e449f453f..b4dbc71ea 100644 --- a/packages_generated/key_manager/src/v1alpha1/index.gen.ts +++ b/packages_generated/key_manager/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { CreateKeyRequest, diff --git a/packages_generated/key_manager/src/v1alpha1/marshalling.gen.ts b/packages_generated/key_manager/src/v1alpha1/marshalling.gen.ts index 13271f64b..b67d20ee8 100644 --- a/packages_generated/key_manager/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/key_manager/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { KeyRotationPolicy, @@ -45,9 +49,15 @@ const unmarshalKeyUsage = (data: unknown): KeyUsage => { } return { - asymmetricEncryption: data.asymmetric_encryption ? data.asymmetric_encryption : undefined, - asymmetricSigning: data.asymmetric_signing ? data.asymmetric_signing : undefined, - symmetricEncryption: data.symmetric_encryption ? data.symmetric_encryption : undefined, + asymmetricEncryption: data.asymmetric_encryption + ? data.asymmetric_encryption + : undefined, + asymmetricSigning: data.asymmetric_signing + ? data.asymmetric_signing + : undefined, + symmetricEncryption: data.symmetric_encryption + ? data.symmetric_encryption + : undefined, } as KeyUsage } @@ -71,7 +81,9 @@ export const unmarshalKey = (data: unknown): Key => { region: data.region, rotatedAt: unmarshalDate(data.rotated_at), rotationCount: data.rotation_count, - rotationPolicy: data.rotation_policy ? unmarshalKeyRotationPolicy(data.rotation_policy) : undefined, + rotationPolicy: data.rotation_policy + ? unmarshalKeyRotationPolicy(data.rotation_policy) + : undefined, state: data.state, tags: data.tags, updatedAt: unmarshalDate(data.updated_at), @@ -122,7 +134,9 @@ export const unmarshalEncryptResponse = (data: unknown): EncryptResponse => { } as EncryptResponse } -const unmarshalListAlgorithmsResponseAlgorithm = (data: unknown): ListAlgorithmsResponseAlgorithm => { +const unmarshalListAlgorithmsResponseAlgorithm = ( + data: unknown, +): ListAlgorithmsResponseAlgorithm => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAlgorithmsResponseAlgorithm' failed as data isn't a dictionary.`, @@ -136,7 +150,9 @@ const unmarshalListAlgorithmsResponseAlgorithm = (data: unknown): ListAlgorithms } as ListAlgorithmsResponseAlgorithm } -export const unmarshalListAlgorithmsResponse = (data: unknown): ListAlgorithmsResponse => { +export const unmarshalListAlgorithmsResponse = ( + data: unknown, +): ListAlgorithmsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary.`, @@ -144,7 +160,10 @@ export const unmarshalListAlgorithmsResponse = (data: unknown): ListAlgorithmsRe } return { - algorithms: unmarshalArrayOfObject(data.algorithms, unmarshalListAlgorithmsResponseAlgorithm), + algorithms: unmarshalArrayOfObject( + data.algorithms, + unmarshalListAlgorithmsResponseAlgorithm, + ), } as ListAlgorithmsResponse } @@ -210,17 +229,11 @@ const marshalKeyRotationPolicy = ( const marshalKeyUsage = ( request: KeyUsage, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'symmetric_encryption', - value: request.symmetricEncryption, - }, - {param: 'asymmetric_encryption', - value: request.asymmetricEncryption, - }, - {param: 'asymmetric_signing', - value: request.asymmetricSigning, - }, + { param: 'symmetric_encryption', value: request.symmetricEncryption }, + { param: 'asymmetric_encryption', value: request.asymmetricEncryption }, + { param: 'asymmetric_signing', value: request.asymmetricSigning }, ]), }) @@ -232,10 +245,16 @@ export const marshalCreateKeyRequest = ( name: request.name, origin: request.origin, project_id: request.projectId ?? defaults.defaultProjectId, - rotation_policy: ((request.rotationPolicy !== undefined) ? marshalKeyRotationPolicy(request.rotationPolicy, defaults): undefined), + rotation_policy: + request.rotationPolicy !== undefined + ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) + : undefined, tags: request.tags, unprotected: request.unprotected, - usage: ((request.usage !== undefined) ? marshalKeyUsage(request.usage, defaults): undefined), + usage: + request.usage !== undefined + ? marshalKeyUsage(request.usage, defaults) + : undefined, }) export const marshalDecryptRequest = ( @@ -283,7 +302,10 @@ export const marshalUpdateKeyRequest = ( ): Record => ({ description: request.description, name: request.name, - rotation_policy: ((request.rotationPolicy !== undefined) ? marshalKeyRotationPolicy(request.rotationPolicy, defaults): undefined), + rotation_policy: + request.rotationPolicy !== undefined + ? marshalKeyRotationPolicy(request.rotationPolicy, defaults) + : undefined, tags: request.tags, }) diff --git a/packages_generated/key_manager/src/v1alpha1/types.gen.ts b/packages_generated/key_manager/src/v1alpha1/types.gen.ts index f5f3ff091..8e16b7f42 100644 --- a/packages_generated/key_manager/src/v1alpha1/types.gen.ts +++ b/packages_generated/key_manager/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type DataKeyAlgorithmSymmetricEncryption = | 'unknown_symmetric_encryption' @@ -28,10 +27,7 @@ export type KeyAlgorithmSymmetricEncryption = | 'unknown_symmetric_encryption' | 'aes_256_gcm' -export type KeyOrigin = - | 'unknown_origin' - | 'scaleway_kms' - | 'external' +export type KeyOrigin = 'unknown_origin' | 'scaleway_kms' | 'external' export type KeyState = | 'unknown_state' @@ -71,7 +67,6 @@ export interface KeyRotationPolicy { nextRotationAt?: Date } - export interface KeyUsage { /** * See the `Key.Algorithm.SymmetricEncryption` enum for a description of values. @@ -93,14 +88,12 @@ export interface KeyUsage { asymmetricSigning?: KeyAlgorithmAsymmetricSigning } - export interface ListAlgorithmsResponseAlgorithm { usage: string name: string recommended: boolean } - export interface Key { /** * ID of the key. @@ -172,7 +165,6 @@ export interface Key { region: ScwRegion } - export type CreateKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -212,7 +204,6 @@ export type CreateKeyRequest = { origin?: KeyOrigin } - export interface DataKey { /** * ID of the data encryption key. @@ -236,7 +227,6 @@ export interface DataKey { createdAt?: Date } - export type DecryptRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -256,7 +246,6 @@ export type DecryptRequest = { associatedData?: string } - export interface DecryptResponse { /** * ID of the key used for decryption. @@ -272,7 +261,6 @@ export interface DecryptResponse { ciphertext?: string } - export type DeleteKeyMaterialRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -284,7 +272,6 @@ export type DeleteKeyMaterialRequest = { keyId: string } - export type DeleteKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -296,7 +283,6 @@ export type DeleteKeyRequest = { keyId: string } - export type DisableKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -308,7 +294,6 @@ export type DisableKeyRequest = { keyId: string } - export type EnableKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -320,7 +305,6 @@ export type EnableKeyRequest = { keyId: string } - export type EncryptRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -340,7 +324,6 @@ export type EncryptRequest = { associatedData?: string } - export interface EncryptResponse { /** * ID of the key used for encryption. @@ -352,7 +335,6 @@ export interface EncryptResponse { ciphertext: string } - export type GenerateDataKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -373,7 +355,6 @@ Set it to `true` if you do not wish the plaintext to be returned in the response withoutPlaintext: boolean } - export type GetKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -385,7 +366,6 @@ export type GetKeyRequest = { keyId: string } - export type GetPublicKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -397,7 +377,6 @@ export type GetPublicKeyRequest = { keyId: string } - export type ImportKeyMaterialRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -417,7 +396,6 @@ export type ImportKeyMaterialRequest = { salt?: string } - export type ListAlgorithmsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -429,7 +407,6 @@ export type ListAlgorithmsRequest = { usages?: ListAlgorithmsRequestUsage[] } - export interface ListAlgorithmsResponse { /** * Returns a list of algorithms matching the requested criteria. @@ -437,7 +414,6 @@ export interface ListAlgorithmsResponse { algorithms: ListAlgorithmsResponseAlgorithm[] } - export type ListKeysRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -472,7 +448,6 @@ export type ListKeysRequest = { scheduledForDeletion: boolean } - export interface ListKeysResponse { /** * Single page of keys matching the requested criteria. @@ -484,7 +459,6 @@ export interface ListKeysResponse { totalCount: number } - export type ProtectKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -496,12 +470,10 @@ export type ProtectKeyRequest = { keyId: string } - export interface PublicKey { pem: string } - export type RestoreKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -510,7 +482,6 @@ export type RestoreKeyRequest = { keyId: string } - export type RotateKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -522,7 +493,6 @@ export type RotateKeyRequest = { keyId: string } - export type SignRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -538,7 +508,6 @@ export type SignRequest = { digest: string } - export interface SignResponse { /** * ID of the key used to generate the signature. @@ -550,7 +519,6 @@ export interface SignResponse { signature: string } - export type UnprotectKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -562,7 +530,6 @@ export type UnprotectKeyRequest = { keyId: string } - export type UpdateKeyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -590,7 +557,6 @@ export type UpdateKeyRequest = { rotationPolicy?: KeyRotationPolicy } - export type VerifyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -610,7 +576,6 @@ export type VerifyRequest = { signature: string } - export interface VerifyResponse { /** * ID of the key used for verification. @@ -621,5 +586,3 @@ export interface VerifyResponse { */ valid: boolean } - - diff --git a/packages_generated/lb/src/v1/api.gen.ts b/packages_generated/lb/src/v1/api.gen.ts index 63cbd8bbd..ffc279206 100644 --- a/packages_generated/lb/src/v1/api.gen.ts +++ b/packages_generated/lb/src/v1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CERTIFICATE_TRANSIENT_STATUSES as CERTIFICATE_TRANSIENT_STATUSES_LB,LB_TRANSIENT_STATUSES as LB_TRANSIENT_STATUSES_LB,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + CERTIFICATE_TRANSIENT_STATUSES as CERTIFICATE_TRANSIENT_STATUSES_LB, + LB_TRANSIENT_STATUSES as LB_TRANSIENT_STATUSES_LB, +} from './content.gen.js' import { unmarshalAcl, marshalAddBackendServersRequest, @@ -230,20 +233,19 @@ export class ZonedAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + protected pageOfListLbs = (request: Readonly = {}) => this.client.fetch( { @@ -254,14 +256,17 @@ export class ZonedAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListLbsResponse, ) - + /** * List Load Balancers. List all Load Balancers in the specified zone, for a Scaleway Organization or Scaleway Project. By default, the Load Balancers returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -271,7 +276,6 @@ export class ZonedAPI extends ParentAPI { listLbs = (request: Readonly = {}) => enrichForPagination('lbs', this.pageOfListLbs, request) - /** * Create a Load Balancer. Create a new Load Balancer. Note that the Load Balancer will be created without frontends or backends; these must be created separately via the dedicated endpoints. * @@ -291,7 +295,6 @@ export class ZonedAPI extends ParentAPI { unmarshalLb, ) - /** * Get a Load Balancer. Retrieve information about an existing Load Balancer, specified by its Load Balancer ID. Its full details, including name, status and IP address, are returned in the response object. * @@ -306,7 +309,7 @@ export class ZonedAPI extends ParentAPI { }, unmarshalLb, ) - + /** * Waits for {@link Lb} to be in a final state. * @@ -319,13 +322,14 @@ export class ZonedAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES_LB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!LB_TRANSIENT_STATUSES_LB.includes(res.status))), this.getLb, request, options, ) - /** * Update a Load Balancer. Update the parameters of an existing Load Balancer, specified by its Load Balancer ID. Note that the request type is PUT and not PATCH. You must set all parameters. * @@ -345,24 +349,18 @@ export class ZonedAPI extends ParentAPI { unmarshalLb, ) - /** * Delete a Load Balancer. Delete an existing Load Balancer, specified by its Load Balancer ID. Deleting a Load Balancer is permanent, and cannot be undone. The Load Balancer's flexible IP address can either be deleted with the Load Balancer, or kept in your account for future use. * * @param request - The request {@link ZonedApiDeleteLbRequest} */ deleteLb = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`, - urlParams: urlParams( - ['release_ip', request.releaseIp], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}`, + urlParams: urlParams(['release_ip', request.releaseIp]), + }) - /** * Migrate a Load Balancer. Migrate an existing Load Balancer from one commercial type to another. Allows you to scale your Load Balancer up or down in terms of bandwidth or multi-cloud provision. * @@ -382,7 +380,6 @@ export class ZonedAPI extends ParentAPI { unmarshalLb, ) - protected pageOfListIPs = (request: Readonly = {}) => this.client.fetch( { @@ -393,14 +390,17 @@ export class ZonedAPI extends ParentAPI { ['ip_type', request.ipType], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListIpsResponse, ) - + /** * List IP addresses. List the Load Balancer flexible IP addresses held in the account (filtered by Organization ID or Project ID). It is also possible to search for a specific IP address. * @@ -410,7 +410,6 @@ export class ZonedAPI extends ParentAPI { listIPs = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIPs, request) - /** * Create an IP address. Create a new Load Balancer flexible IP address, in the specified Scaleway Project. This can be attached to new Load Balancers created in the future. * @@ -430,7 +429,6 @@ export class ZonedAPI extends ParentAPI { unmarshalIp, ) - /** * Get an IP address. Retrieve the full details of a Load Balancer flexible IP address. * @@ -446,21 +444,17 @@ export class ZonedAPI extends ParentAPI { unmarshalIp, ) - /** * Delete an IP address. Delete a Load Balancer flexible IP address. This action is irreversible, and cannot be undone. * * @param request - The request {@link ZonedApiReleaseIpRequest} */ releaseIp = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, + }) - /** * Update an IP address. Update the reverse DNS of a Load Balancer flexible IP address. * @@ -480,8 +474,9 @@ export class ZonedAPI extends ParentAPI { unmarshalIp, ) - - protected pageOfListBackends = (request: Readonly) => + protected pageOfListBackends = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -490,12 +485,15 @@ export class ZonedAPI extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackendsResponse, ) - + /** * List the backends of a given Load Balancer. List all the backends of a Load Balancer, specified by its Load Balancer ID. By default, results are returned in ascending order by the creation date of each backend. The response is an array of backend objects, containing full details of each one including their configuration parameters such as protocol, port and forwarding algorithm. * @@ -505,7 +503,6 @@ export class ZonedAPI extends ParentAPI { listBackends = (request: Readonly) => enrichForPagination('backends', this.pageOfListBackends, request) - /** * Create a backend for a given Load Balancer. Create a new backend for a given Load Balancer, specifying its full configuration including protocol, port and forwarding algorithm. * @@ -525,7 +522,6 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Get a backend of a given Load Balancer. Get the full details of a given backend, specified by its backend ID. The response contains the backend's full configuration parameters including protocol, port and forwarding algorithm. * @@ -541,7 +537,6 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Update a backend of a given Load Balancer. Update a backend of a given Load Balancer, specified by its backend ID. Note that the request type is PUT and not PATCH. You must set all parameters. * @@ -561,21 +556,17 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Delete a backend of a given Load Balancer. Delete a backend of a given Load Balancer, specified by its backend ID. This action is irreversible and cannot be undone. * * @param request - The request {@link ZonedApiDeleteBackendRequest} */ deleteBackend = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/backends/${validatePathParam('backendId', request.backendId)}`, + }) - /** * Add a set of backend servers to a given backend. For a given backend specified by its backend ID, add a set of backend servers (identified by their IP addresses) it should forward traffic to. These will be appended to any existing set of backend servers for this backend. * @@ -586,7 +577,10 @@ export class ZonedAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalZonedApiAddBackendServersRequest(request, this.client.settings), + marshalZonedApiAddBackendServersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -595,18 +589,22 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Remove a set of servers for a given backend. For a given backend specified by its backend ID, remove the specified backend servers (identified by their IP addresses) so that it no longer forwards traffic to them. * * @param request - The request {@link ZonedApiRemoveBackendServersRequest} * @returns A Promise of Backend */ - removeBackendServers = (request: Readonly) => + removeBackendServers = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalZonedApiRemoveBackendServersRequest(request, this.client.settings), + marshalZonedApiRemoveBackendServersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'DELETE', @@ -615,7 +613,6 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Define all backend servers for a given backend. For a given backend specified by its backend ID, define the set of backend servers (identified by their IP addresses) that it should forward traffic to. Any existing backend servers configured for this backend will be removed. * @@ -626,7 +623,10 @@ export class ZonedAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalZonedApiSetBackendServersRequest(request, this.client.settings), + marshalZonedApiSetBackendServersRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -635,7 +635,6 @@ export class ZonedAPI extends ParentAPI { unmarshalBackend, ) - /** * Update a health check for a given backend. Update the configuration of the health check performed by a given backend to verify the health of its backend servers, identified by its backend ID. Note that the request type is PUT and not PATCH. You must set all parameters. * @@ -646,7 +645,10 @@ export class ZonedAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalZonedApiUpdateHealthCheckRequest(request, this.client.settings), + marshalZonedApiUpdateHealthCheckRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -655,8 +657,9 @@ export class ZonedAPI extends ParentAPI { unmarshalHealthCheck, ) - - protected pageOfListFrontends = (request: Readonly) => + protected pageOfListFrontends = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -665,12 +668,15 @@ export class ZonedAPI extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListFrontendsResponse, ) - + /** * List frontends of a given Load Balancer. List all the frontends of a Load Balancer, specified by its Load Balancer ID. By default, results are returned in ascending order by the creation date of each frontend. The response is an array of frontend objects, containing full details of each one including the port they listen on and the backend they are attached to. * @@ -680,7 +686,6 @@ export class ZonedAPI extends ParentAPI { listFrontends = (request: Readonly) => enrichForPagination('frontends', this.pageOfListFrontends, request) - /** * Create a frontend in a given Load Balancer. Create a new frontend for a given Load Balancer, specifying its configuration including the port it should listen on and the backend to attach it to. * @@ -700,7 +705,6 @@ export class ZonedAPI extends ParentAPI { unmarshalFrontend, ) - /** * Get a frontend. Get the full details of a given frontend, specified by its frontend ID. The response contains the frontend's full configuration parameters including the backend it is attached to, the port it listens on, and any certificates it has. * @@ -716,7 +720,6 @@ export class ZonedAPI extends ParentAPI { unmarshalFrontend, ) - /** * Update a frontend. Update a given frontend, specified by its frontend ID. You can update configuration parameters including its name and the port it listens on. Note that the request type is PUT and not PATCH. You must set all parameters. * @@ -736,22 +739,20 @@ export class ZonedAPI extends ParentAPI { unmarshalFrontend, ) - /** * Delete a frontend. Delete a given frontend, specified by its frontend ID. This action is irreversible and cannot be undone. * * @param request - The request {@link ZonedApiDeleteFrontendRequest} */ deleteFrontend = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/frontends/${validatePathParam('frontendId', request.frontendId)}`, + }) - - protected pageOfListRoutes = (request: Readonly = {}) => + protected pageOfListRoutes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -760,12 +761,15 @@ export class ZonedAPI extends ParentAPI { ['frontend_id', request.frontendId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListRoutesResponse, ) - + /** * List all routes. List all routes for a given frontend. The response is an array of routes, each one with a specified backend to direct to if a certain condition is matched (based on the value of the SNI field or HTTP Host header). * @@ -775,7 +779,6 @@ export class ZonedAPI extends ParentAPI { listRoutes = (request: Readonly = {}) => enrichForPagination('routes', this.pageOfListRoutes, request) - /** * Create a route. Create a new route on a given frontend. To configure a route, specify the backend to direct to if a certain condition is matched (based on the value of the SNI field or HTTP Host header). * @@ -795,7 +798,6 @@ export class ZonedAPI extends ParentAPI { unmarshalRoute, ) - /** * Get a route. Retrieve information about an existing route, specified by its route ID. Its full details, origin frontend, target backend and match condition, are returned in the response object. * @@ -811,7 +813,6 @@ export class ZonedAPI extends ParentAPI { unmarshalRoute, ) - /** * Update a route. Update the configuration of an existing route, specified by its route ID. * @@ -831,21 +832,17 @@ export class ZonedAPI extends ParentAPI { unmarshalRoute, ) - /** * Delete a route. Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone. * * @param request - The request {@link ZonedApiDeleteRouteRequest} */ deleteRoute = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/routes/${validatePathParam('routeId', request.routeId)}`, + }) - /** * Get usage statistics of a given Load Balancer. * @@ -858,15 +855,14 @@ export class ZonedAPI extends ParentAPI { { method: 'GET', path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`, - urlParams: urlParams( - ['backend_id', request.backendId], - ), + urlParams: urlParams(['backend_id', request.backendId]), }, unmarshalLbStats, ) - - protected pageOfListBackendStats = (request: Readonly) => + protected pageOfListBackendStats = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -874,12 +870,15 @@ export class ZonedAPI extends ParentAPI { urlParams: urlParams( ['backend_id', request.backendId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackendStatsResponse, ) - + /** * List backend server statistics. List information about your backend servers, including their state and the result of their last health check. * @@ -887,9 +886,12 @@ export class ZonedAPI extends ParentAPI { * @returns A Promise of ListBackendStatsResponse */ listBackendStats = (request: Readonly) => - enrichForPagination('backendServersStats', this.pageOfListBackendStats, request) + enrichForPagination( + 'backendServersStats', + this.pageOfListBackendStats, + request, + ) - protected pageOfListAcls = (request: Readonly) => this.client.fetch( { @@ -899,12 +901,15 @@ export class ZonedAPI extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListAclResponse, ) - + /** * List ACLs for a given frontend. List the ACLs for a given frontend, specified by its frontend ID. The response is an array of ACL objects, each one representing an ACL that denies or allows traffic based on certain conditions. * @@ -914,7 +919,6 @@ export class ZonedAPI extends ParentAPI { listAcls = (request: Readonly) => enrichForPagination('acls', this.pageOfListAcls, request) - /** * Create an ACL for a given frontend. Create a new ACL for a given frontend. Each ACL must have a name, an action to perform (allow or deny), and a match rule (the action is carried out when the incoming traffic matches the rule). * @@ -934,7 +938,6 @@ export class ZonedAPI extends ParentAPI { unmarshalAcl, ) - /** * Get an ACL. Get information for a particular ACL, specified by its ACL ID. The response returns full details of the ACL, including its name, action, match rule and frontend. * @@ -950,7 +953,6 @@ export class ZonedAPI extends ParentAPI { unmarshalAcl, ) - /** * Update an ACL. Update a particular ACL, specified by its ACL ID. You can update details including its name, action and match rule. * @@ -970,21 +972,17 @@ export class ZonedAPI extends ParentAPI { unmarshalAcl, ) - /** * Delete an ACL. Delete an ACL, specified by its ACL ID. Deleting an ACL is irreversible and cannot be undone. * * @param request - The request {@link ZonedApiDeleteAclRequest} */ deleteAcl = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/acls/${validatePathParam('aclId', request.aclId)}`, + }) - /** * Define all ACLs for a given frontend. For a given frontend specified by its frontend ID, define and add the complete set of ACLS for that frontend. Any existing ACLs on this frontend will be removed. * @@ -1004,7 +1002,6 @@ export class ZonedAPI extends ParentAPI { unmarshalSetAclsResponse, ) - /** * Create an SSL/TLS certificate. Generate a new SSL/TLS certificate for a given Load Balancer. You can choose to create a Let's Encrypt certificate, or import a custom certificate. * @@ -1015,7 +1012,10 @@ export class ZonedAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalZonedApiCreateCertificateRequest(request, this.client.settings), + marshalZonedApiCreateCertificateRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1024,8 +1024,9 @@ export class ZonedAPI extends ParentAPI { unmarshalCertificate, ) - - protected pageOfListCertificates = (request: Readonly) => + protected pageOfListCertificates = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1034,12 +1035,15 @@ export class ZonedAPI extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCertificatesResponse, ) - + /** * List all SSL/TLS certificates on a given Load Balancer. List all the SSL/TLS certificates on a given Load Balancer. The response is an array of certificate objects, which are by default listed in ascending order of creation date. * @@ -1049,7 +1053,6 @@ export class ZonedAPI extends ParentAPI { listCertificates = (request: Readonly) => enrichForPagination('certificates', this.pageOfListCertificates, request) - /** * Get an SSL/TLS certificate. Get information for a particular SSL/TLS certificate, specified by its certificate ID. The response returns full details of the certificate, including its type, main domain name, and alternative domain names. * @@ -1064,7 +1067,7 @@ export class ZonedAPI extends ParentAPI { }, unmarshalCertificate, ) - + /** * Waits for {@link Certificate} to be in a final state. * @@ -1077,13 +1080,16 @@ export class ZonedAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES_LB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CERTIFICATE_TRANSIENT_STATUSES_LB.includes(res.status), + )), this.getCertificate, request, options, ) - /** * Update an SSL/TLS certificate. Update the name of a particular SSL/TLS certificate, specified by its certificate ID. * @@ -1094,7 +1100,10 @@ export class ZonedAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalZonedApiUpdateCertificateRequest(request, this.client.settings), + marshalZonedApiUpdateCertificateRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PUT', @@ -1103,34 +1112,35 @@ export class ZonedAPI extends ParentAPI { unmarshalCertificate, ) - /** * Delete an SSL/TLS certificate. Delete an SSL/TLS certificate, specified by its certificate ID. Deleting a certificate is irreversible and cannot be undone. * * @param request - The request {@link ZonedApiDeleteCertificateRequest} */ deleteCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/certificates/${validatePathParam('certificateId', request.certificateId)}`, + }) - - protected pageOfListLbTypes = (request: Readonly = {}) => + protected pageOfListLbTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListLbTypesResponse, ) - + /** * List all Load Balancer offer types. List all the different commercial Load Balancer types. The response includes an array of offer types, each with a name, description, and information about its stock availability. * @@ -1140,7 +1150,6 @@ export class ZonedAPI extends ParentAPI { listLbTypes = (request: Readonly = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request) - /** * Create a subscriber. Create a new subscriber, either with an email configuration or a webhook configuration, for a specified Scaleway Project. * @@ -1160,7 +1169,6 @@ export class ZonedAPI extends ParentAPI { unmarshalSubscriber, ) - /** * Get a subscriber. Retrieve information about an existing subscriber, specified by its subscriber ID. Its full details, including name and email/webhook configuration, are returned in the response object. * @@ -1176,8 +1184,9 @@ export class ZonedAPI extends ParentAPI { unmarshalSubscriber, ) - - protected pageOfListSubscriber = (request: Readonly = {}) => + protected pageOfListSubscriber = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1187,13 +1196,16 @@ export class ZonedAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSubscriberResponse, ) - + /** * List all subscribers. List all subscribers to Load Balancer alerts. By default, returns all subscribers to Load Balancer alerts for the Organization associated with the authentication token used for the request. * @@ -1203,7 +1215,6 @@ export class ZonedAPI extends ParentAPI { listSubscriber = (request: Readonly = {}) => enrichForPagination('subscribers', this.pageOfListSubscriber, request) - /** * Update a subscriber. Update the parameters of a given subscriber (e.g. name, webhook configuration, email configuration), specified by its subscriber ID. * @@ -1223,21 +1234,17 @@ export class ZonedAPI extends ParentAPI { unmarshalSubscriber, ) - /** * Delete a subscriber. Delete an existing subscriber, specified by its subscriber ID. Deleting a subscriber is permanent, and cannot be undone. * * @param request - The request {@link ZonedApiDeleteSubscriberRequest} */ deleteSubscriber = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lb/subscription/${validatePathParam('subscriberId', request.subscriberId)}`, + }) - /** * Subscribe a subscriber to alerts for a given Load Balancer. Subscribe an existing subscriber to alerts for a given Load Balancer. * @@ -1257,7 +1264,6 @@ export class ZonedAPI extends ParentAPI { unmarshalLb, ) - /** * Unsubscribe a subscriber from alerts for a given Load Balancer. Unsubscribe a subscriber from alerts for a given Load Balancer. The subscriber is not deleted, and can be resubscribed in the future if necessary. * @@ -1273,8 +1279,9 @@ export class ZonedAPI extends ParentAPI { unmarshalLb, ) - - protected pageOfListLbPrivateNetworks = (request: Readonly) => + protected pageOfListLbPrivateNetworks = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1282,33 +1289,46 @@ export class ZonedAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListLbPrivateNetworksResponse, ) - + /** * List Private Networks attached to a Load Balancer. List the Private Networks attached to a given Load Balancer, specified by its Load Balancer ID. The response is an array of Private Network objects, giving information including the status, configuration, name and creation date of each Private Network. * * @param request - The request {@link ZonedApiListLbPrivateNetworksRequest} * @returns A Promise of ListLbPrivateNetworksResponse */ - listLbPrivateNetworks = (request: Readonly) => - enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request) + listLbPrivateNetworks = ( + request: Readonly, + ) => + enrichForPagination( + 'privateNetwork', + this.pageOfListLbPrivateNetworks, + request, + ) - /** * Attach a Load Balancer to a Private Network. Attach a specified Load Balancer to a specified Private Network, defining a static or DHCP configuration for the Load Balancer on the network. * * @param request - The request {@link ZonedApiAttachPrivateNetworkRequest} * @returns A Promise of PrivateNetwork */ - attachPrivateNetwork = (request: Readonly) => + attachPrivateNetwork = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalZonedApiAttachPrivateNetworkRequest(request, this.client.settings), + marshalZonedApiAttachPrivateNetworkRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1317,25 +1337,25 @@ export class ZonedAPI extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Detach Load Balancer from Private Network. Detach a specified Load Balancer from a specified Private Network. * * @param request - The request {@link ZonedApiDetachPrivateNetworkRequest} */ - detachPrivateNetwork = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalZonedApiDetachPrivateNetworkRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/detach-private-network`, - }, - ) - - + detachPrivateNetwork = ( + request: Readonly, + ) => + this.client.fetch({ + body: JSON.stringify( + marshalZonedApiDetachPrivateNetworkRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/lb/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/lbs/${validatePathParam('lbId', request.lbId)}/detach-private-network`, + }) } /** @@ -1348,15 +1368,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + protected pageOfListLbs = (request: Readonly = {}) => this.client.fetch( { @@ -1367,14 +1382,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListLbsResponse, ) - + /** * List load balancers. * @@ -1384,7 +1402,6 @@ export class API extends ParentAPI { listLbs = (request: Readonly = {}) => enrichForPagination('lbs', this.pageOfListLbs, request) - /** * Create a load balancer. * @@ -1404,7 +1421,6 @@ export class API extends ParentAPI { unmarshalLb, ) - /** * Get a load balancer. * @@ -1419,7 +1435,7 @@ export class API extends ParentAPI { }, unmarshalLb, ) - + /** * Waits for {@link Lb} to be in a final state. * @@ -1432,13 +1448,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!LB_TRANSIENT_STATUSES_LB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!LB_TRANSIENT_STATUSES_LB.includes(res.status))), this.getLb, request, options, ) - /** * Update a load balancer. * @@ -1458,24 +1475,18 @@ export class API extends ParentAPI { unmarshalLb, ) - /** * Delete a load balancer. * * @param request - The request {@link DeleteLbRequest} */ deleteLb = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`, - urlParams: urlParams( - ['release_ip', request.releaseIp], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}`, + urlParams: urlParams(['release_ip', request.releaseIp]), + }) - /** * Migrate a load balancer. * @@ -1495,7 +1506,6 @@ export class API extends ParentAPI { unmarshalLb, ) - protected pageOfListIPs = (request: Readonly = {}) => this.client.fetch( { @@ -1506,14 +1516,17 @@ export class API extends ParentAPI { ['ip_type', request.ipType], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListIpsResponse, ) - + /** * List IPs. * @@ -1523,7 +1536,6 @@ export class API extends ParentAPI { listIPs = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIPs, request) - /** * Create an IP. * @@ -1543,7 +1555,6 @@ export class API extends ParentAPI { unmarshalIp, ) - /** * Get an IP. * @@ -1559,21 +1570,17 @@ export class API extends ParentAPI { unmarshalIp, ) - /** * Delete an IP. * * @param request - The request {@link ReleaseIpRequest} */ releaseIp = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`, + }) - /** * Update an IP. * @@ -1593,7 +1600,6 @@ export class API extends ParentAPI { unmarshalIp, ) - protected pageOfListBackends = (request: Readonly) => this.client.fetch( { @@ -1603,12 +1609,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackendsResponse, ) - + /** * List backends in a given load balancer. * @@ -1618,7 +1627,6 @@ export class API extends ParentAPI { listBackends = (request: Readonly) => enrichForPagination('backends', this.pageOfListBackends, request) - /** * Create a backend in a given load balancer. * @@ -1638,7 +1646,6 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Get a backend in a given load balancer. * @@ -1654,7 +1661,6 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Update a backend in a given load balancer. * @@ -1674,21 +1680,17 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Delete a backend in a given load balancer. * * @param request - The request {@link DeleteBackendRequest} */ deleteBackend = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/backends/${validatePathParam('backendId', request.backendId)}`, + }) - /** * Add a set of servers in a given backend. * @@ -1708,7 +1710,6 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Remove a set of servers for a given backend. * @@ -1728,7 +1729,6 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Define all servers in a given backend. * @@ -1748,7 +1748,6 @@ export class API extends ParentAPI { unmarshalBackend, ) - /** * Update an health check for a given backend. * @@ -1768,7 +1767,6 @@ export class API extends ParentAPI { unmarshalHealthCheck, ) - protected pageOfListFrontends = (request: Readonly) => this.client.fetch( { @@ -1778,12 +1776,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListFrontendsResponse, ) - + /** * List frontends in a given load balancer. * @@ -1793,7 +1794,6 @@ export class API extends ParentAPI { listFrontends = (request: Readonly) => enrichForPagination('frontends', this.pageOfListFrontends, request) - /** * Create a frontend in a given load balancer. * @@ -1813,7 +1813,6 @@ export class API extends ParentAPI { unmarshalFrontend, ) - /** * Get a frontend. * @@ -1829,7 +1828,6 @@ export class API extends ParentAPI { unmarshalFrontend, ) - /** * Update a frontend. * @@ -1849,21 +1847,17 @@ export class API extends ParentAPI { unmarshalFrontend, ) - /** * Delete a frontend. * * @param request - The request {@link DeleteFrontendRequest} */ deleteFrontend = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/frontends/${validatePathParam('frontendId', request.frontendId)}`, + }) - protected pageOfListRoutes = (request: Readonly = {}) => this.client.fetch( { @@ -1873,12 +1867,15 @@ export class API extends ParentAPI { ['frontend_id', request.frontendId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListRoutesResponse, ) - + /** * List all backend redirections. * @@ -1888,7 +1885,6 @@ export class API extends ParentAPI { listRoutes = (request: Readonly = {}) => enrichForPagination('routes', this.pageOfListRoutes, request) - /** * Create a backend redirection. * @@ -1908,7 +1904,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Get single backend redirection. * @@ -1924,7 +1919,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Edit a backend redirection. * @@ -1944,21 +1938,17 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Delete a backend redirection. * * @param request - The request {@link DeleteRouteRequest} */ deleteRoute = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, + }) - /** * Get usage statistics of a given load balancer. * @@ -1971,15 +1961,14 @@ export class API extends ParentAPI { { method: 'GET', path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/stats`, - urlParams: urlParams( - ['backend_id', request.backendId], - ), + urlParams: urlParams(['backend_id', request.backendId]), }, unmarshalLbStats, ) - - protected pageOfListBackendStats = (request: Readonly) => + protected pageOfListBackendStats = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1987,12 +1976,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['backend_id', request.backendId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackendStatsResponse, ) - + /** * List backend server statistics. * @@ -2000,9 +1992,12 @@ export class API extends ParentAPI { * @returns A Promise of ListBackendStatsResponse */ listBackendStats = (request: Readonly) => - enrichForPagination('backendServersStats', this.pageOfListBackendStats, request) + enrichForPagination( + 'backendServersStats', + this.pageOfListBackendStats, + request, + ) - protected pageOfListAcls = (request: Readonly) => this.client.fetch( { @@ -2012,12 +2007,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListAclResponse, ) - + /** * List ACL for a given frontend. * @@ -2027,7 +2025,6 @@ export class API extends ParentAPI { listAcls = (request: Readonly) => enrichForPagination('acls', this.pageOfListAcls, request) - /** * Create an ACL for a given frontend. * @@ -2047,7 +2044,6 @@ export class API extends ParentAPI { unmarshalAcl, ) - /** * Get an ACL. * @@ -2063,7 +2059,6 @@ export class API extends ParentAPI { unmarshalAcl, ) - /** * Update an ACL. * @@ -2083,21 +2078,17 @@ export class API extends ParentAPI { unmarshalAcl, ) - /** * Delete an ACL. * * @param request - The request {@link DeleteAclRequest} */ deleteAcl = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/acls/${validatePathParam('aclId', request.aclId)}`, + }) - /** * Create a TLS certificate. Generate a new TLS certificate using Let's Encrypt or import your certificate. * @@ -2117,8 +2108,9 @@ export class API extends ParentAPI { unmarshalCertificate, ) - - protected pageOfListCertificates = (request: Readonly) => + protected pageOfListCertificates = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -2127,12 +2119,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCertificatesResponse, ) - + /** * List all TLS certificates on a given load balancer. * @@ -2142,7 +2137,6 @@ export class API extends ParentAPI { listCertificates = (request: Readonly) => enrichForPagination('certificates', this.pageOfListCertificates, request) - /** * Get a TLS certificate. * @@ -2157,7 +2151,7 @@ export class API extends ParentAPI { }, unmarshalCertificate, ) - + /** * Waits for {@link Certificate} to be in a final state. * @@ -2170,13 +2164,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CERTIFICATE_TRANSIENT_STATUSES_LB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CERTIFICATE_TRANSIENT_STATUSES_LB.includes(res.status), + )), this.getCertificate, request, options, ) - /** * Update a TLS certificate. * @@ -2196,21 +2193,17 @@ export class API extends ParentAPI { unmarshalCertificate, ) - /** * Delete a TLS certificate. * * @param request - The request {@link DeleteCertificateRequest} */ deleteCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/certificates/${validatePathParam('certificateId', request.certificateId)}`, + }) - protected pageOfListLbTypes = (request: Readonly = {}) => this.client.fetch( { @@ -2218,12 +2211,15 @@ export class API extends ParentAPI { path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListLbTypesResponse, ) - + /** * List all load balancer offer type. * @@ -2233,7 +2229,6 @@ export class API extends ParentAPI { listLbTypes = (request: Readonly = {}) => enrichForPagination('lbTypes', this.pageOfListLbTypes, request) - /** * Create a subscriber, webhook or email. * @@ -2253,7 +2248,6 @@ export class API extends ParentAPI { unmarshalSubscriber, ) - /** * Get a subscriber. * @@ -2269,8 +2263,9 @@ export class API extends ParentAPI { unmarshalSubscriber, ) - - protected pageOfListSubscriber = (request: Readonly = {}) => + protected pageOfListSubscriber = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -2280,13 +2275,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSubscriberResponse, ) - + /** * List all subscriber. * @@ -2296,7 +2294,6 @@ export class API extends ParentAPI { listSubscriber = (request: Readonly = {}) => enrichForPagination('subscribers', this.pageOfListSubscriber, request) - /** * Update a subscriber. * @@ -2316,21 +2313,17 @@ export class API extends ParentAPI { unmarshalSubscriber, ) - /** * Delete a subscriber. * * @param request - The request {@link DeleteSubscriberRequest} */ deleteSubscriber = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lb/subscriber/${validatePathParam('subscriberId', request.subscriberId)}`, + }) - /** * Subscribe a subscriber to a given load balancer. * @@ -2350,7 +2343,6 @@ export class API extends ParentAPI { unmarshalLb, ) - /** * Unsubscribe a subscriber from a given load balancer. * @@ -2366,8 +2358,9 @@ export class API extends ParentAPI { unmarshalLb, ) - - protected pageOfListLbPrivateNetworks = (request: Readonly) => + protected pageOfListLbPrivateNetworks = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -2375,12 +2368,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListLbPrivateNetworksResponse, ) - + /** * List attached private network of load balancer. * @@ -2388,9 +2384,12 @@ export class API extends ParentAPI { * @returns A Promise of ListLbPrivateNetworksResponse */ listLbPrivateNetworks = (request: Readonly) => - enrichForPagination('privateNetwork', this.pageOfListLbPrivateNetworks, request) + enrichForPagination( + 'privateNetwork', + this.pageOfListLbPrivateNetworks, + request, + ) - /** * Add load balancer on instance private network. * @@ -2410,22 +2409,16 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Remove load balancer of private network. * * @param request - The request {@link DetachPrivateNetworkRequest} */ detachPrivateNetwork = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`, - }, - ) - - + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/lb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/lbs/${validatePathParam('lbId', request.lbId)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/detach`, + }) } - diff --git a/packages_generated/lb/src/v1/content.gen.ts b/packages_generated/lb/src/v1/content.gen.ts index b4e345525..c07735bc0 100644 --- a/packages_generated/lb/src/v1/content.gen.ts +++ b/packages_generated/lb/src/v1/content.gen.ts @@ -7,11 +7,8 @@ import type { PrivateNetworkStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link CertificateStatus}. */ -export const CERTIFICATE_TRANSIENT_STATUSES: CertificateStatus[] = [ - 'pending', -] +export const CERTIFICATE_TRANSIENT_STATUSES: CertificateStatus[] = ['pending'] /** Lists transient statutes of the enum {@link InstanceStatus}. */ export const INSTANCE_TRANSIENT_STATUSES: InstanceStatus[] = [ @@ -33,4 +30,3 @@ export const LB_TRANSIENT_STATUSES: LbStatus[] = [ export const PRIVATE_NETWORK_TRANSIENT_STATUSES: PrivateNetworkStatus[] = [ 'pending', ] - diff --git a/packages_generated/lb/src/v1/marshalling.gen.ts b/packages_generated/lb/src/v1/marshalling.gen.ts index 4f5650555..ab2547b57 100644 --- a/packages_generated/lb/src/v1/marshalling.gen.ts +++ b/packages_generated/lb/src/v1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Ip, @@ -119,7 +124,9 @@ export const unmarshalIp = (data: unknown): Ip => { } as Ip } -const unmarshalSubscriberEmailConfig = (data: unknown): SubscriberEmailConfig => { +const unmarshalSubscriberEmailConfig = ( + data: unknown, +): SubscriberEmailConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SubscriberEmailConfig' failed as data isn't a dictionary.`, @@ -131,7 +138,9 @@ const unmarshalSubscriberEmailConfig = (data: unknown): SubscriberEmailConfig => } as SubscriberEmailConfig } -const unmarshalSubscriberWebhookConfig = (data: unknown): SubscriberWebhookConfig => { +const unmarshalSubscriberWebhookConfig = ( + data: unknown, +): SubscriberWebhookConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SubscriberWebhookConfig' failed as data isn't a dictionary.`, @@ -151,14 +160,20 @@ export const unmarshalSubscriber = (data: unknown): Subscriber => { } return { - emailConfig: data.email_config ? unmarshalSubscriberEmailConfig(data.email_config) : undefined, + emailConfig: data.email_config + ? unmarshalSubscriberEmailConfig(data.email_config) + : undefined, id: data.id, name: data.name, - webhookConfig: data.webhook_config ? unmarshalSubscriberWebhookConfig(data.webhook_config) : undefined, + webhookConfig: data.webhook_config + ? unmarshalSubscriberWebhookConfig(data.webhook_config) + : undefined, } as Subscriber } -const unmarshalHealthCheckHttpConfig = (data: unknown): HealthCheckHttpConfig => { +const unmarshalHealthCheckHttpConfig = ( + data: unknown, +): HealthCheckHttpConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckHttpConfig' failed as data isn't a dictionary.`, @@ -173,7 +188,9 @@ const unmarshalHealthCheckHttpConfig = (data: unknown): HealthCheckHttpConfig => } as HealthCheckHttpConfig } -const unmarshalHealthCheckHttpsConfig = (data: unknown): HealthCheckHttpsConfig => { +const unmarshalHealthCheckHttpsConfig = ( + data: unknown, +): HealthCheckHttpsConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckHttpsConfig' failed as data isn't a dictionary.`, @@ -189,18 +206,21 @@ const unmarshalHealthCheckHttpsConfig = (data: unknown): HealthCheckHttpsConfig } as HealthCheckHttpsConfig } -const unmarshalHealthCheckLdapConfig = (data: unknown): HealthCheckLdapConfig => { +const unmarshalHealthCheckLdapConfig = ( + data: unknown, +): HealthCheckLdapConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckLdapConfig' failed as data isn't a dictionary.`, ) } - return { - } as HealthCheckLdapConfig + return {} as HealthCheckLdapConfig } -const unmarshalHealthCheckMysqlConfig = (data: unknown): HealthCheckMysqlConfig => { +const unmarshalHealthCheckMysqlConfig = ( + data: unknown, +): HealthCheckMysqlConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckMysqlConfig' failed as data isn't a dictionary.`, @@ -212,7 +232,9 @@ const unmarshalHealthCheckMysqlConfig = (data: unknown): HealthCheckMysqlConfig } as HealthCheckMysqlConfig } -const unmarshalHealthCheckPgsqlConfig = (data: unknown): HealthCheckPgsqlConfig => { +const unmarshalHealthCheckPgsqlConfig = ( + data: unknown, +): HealthCheckPgsqlConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckPgsqlConfig' failed as data isn't a dictionary.`, @@ -224,15 +246,16 @@ const unmarshalHealthCheckPgsqlConfig = (data: unknown): HealthCheckPgsqlConfig } as HealthCheckPgsqlConfig } -const unmarshalHealthCheckRedisConfig = (data: unknown): HealthCheckRedisConfig => { +const unmarshalHealthCheckRedisConfig = ( + data: unknown, +): HealthCheckRedisConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HealthCheckRedisConfig' failed as data isn't a dictionary.`, ) } - return { - } as HealthCheckRedisConfig + return {} as HealthCheckRedisConfig } const unmarshalHealthCheckTcpConfig = (data: unknown): HealthCheckTcpConfig => { @@ -242,8 +265,7 @@ const unmarshalHealthCheckTcpConfig = (data: unknown): HealthCheckTcpConfig => { ) } - return { - } as HealthCheckTcpConfig + return {} as HealthCheckTcpConfig } export const unmarshalHealthCheck = (data: unknown): HealthCheck => { @@ -258,14 +280,28 @@ export const unmarshalHealthCheck = (data: unknown): HealthCheck => { checkMaxRetries: data.check_max_retries, checkSendProxy: data.check_send_proxy, checkTimeout: data.check_timeout, - httpConfig: data.http_config ? unmarshalHealthCheckHttpConfig(data.http_config) : undefined, - httpsConfig: data.https_config ? unmarshalHealthCheckHttpsConfig(data.https_config) : undefined, - ldapConfig: data.ldap_config ? unmarshalHealthCheckLdapConfig(data.ldap_config) : undefined, - mysqlConfig: data.mysql_config ? unmarshalHealthCheckMysqlConfig(data.mysql_config) : undefined, - pgsqlConfig: data.pgsql_config ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) : undefined, + httpConfig: data.http_config + ? unmarshalHealthCheckHttpConfig(data.http_config) + : undefined, + httpsConfig: data.https_config + ? unmarshalHealthCheckHttpsConfig(data.https_config) + : undefined, + ldapConfig: data.ldap_config + ? unmarshalHealthCheckLdapConfig(data.ldap_config) + : undefined, + mysqlConfig: data.mysql_config + ? unmarshalHealthCheckMysqlConfig(data.mysql_config) + : undefined, + pgsqlConfig: data.pgsql_config + ? unmarshalHealthCheckPgsqlConfig(data.pgsql_config) + : undefined, port: data.port, - redisConfig: data.redis_config ? unmarshalHealthCheckRedisConfig(data.redis_config) : undefined, - tcpConfig: data.tcp_config ? unmarshalHealthCheckTcpConfig(data.tcp_config) : undefined, + redisConfig: data.redis_config + ? unmarshalHealthCheckRedisConfig(data.redis_config) + : undefined, + tcpConfig: data.tcp_config + ? unmarshalHealthCheckTcpConfig(data.tcp_config) + : undefined, transientCheckDelay: data.transient_check_delay, } as HealthCheck } @@ -311,7 +347,9 @@ export const unmarshalLb = (data: unknown): Lb => { routeCount: data.route_count, sslCompatibilityLevel: data.ssl_compatibility_level, status: data.status, - subscriber: data.subscriber ? unmarshalSubscriber(data.subscriber) : undefined, + subscriber: data.subscriber + ? unmarshalSubscriber(data.subscriber) + : undefined, tags: data.tags, type: data.type, updatedAt: unmarshalDate(data.updated_at), @@ -332,7 +370,9 @@ export const unmarshalBackend = (data: unknown): Backend => { forwardPort: data.forward_port, forwardPortAlgorithm: data.forward_port_algorithm, forwardProtocol: data.forward_protocol, - healthCheck: data.health_check ? unmarshalHealthCheck(data.health_check) : undefined, + healthCheck: data.health_check + ? unmarshalHealthCheck(data.health_check) + : undefined, id: data.id, ignoreSslServerVerify: data.ignore_ssl_server_verify, lb: data.lb ? unmarshalLb(data.lb) : undefined, @@ -388,7 +428,9 @@ export const unmarshalFrontend = (data: unknown): Frontend => { return { backend: data.backend ? unmarshalBackend(data.backend) : undefined, - certificate: data.certificate ? unmarshalCertificate(data.certificate) : undefined, + certificate: data.certificate + ? unmarshalCertificate(data.certificate) + : undefined, certificateIds: data.certificate_ids, connectionRateLimit: data.connection_rate_limit, createdAt: unmarshalDate(data.created_at), @@ -425,7 +467,9 @@ const unmarshalAclAction = (data: unknown): AclAction => { } return { - redirect: data.redirect ? unmarshalAclActionRedirect(data.redirect) : undefined, + redirect: data.redirect + ? unmarshalAclActionRedirect(data.redirect) + : undefined, type: data.type, } as AclAction } @@ -467,7 +511,9 @@ export const unmarshalAcl = (data: unknown): Acl => { } as Acl } -const unmarshalPrivateNetworkDHCPConfig = (data: unknown): PrivateNetworkDHCPConfig => { +const unmarshalPrivateNetworkDHCPConfig = ( + data: unknown, +): PrivateNetworkDHCPConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PrivateNetworkDHCPConfig' failed as data isn't a dictionary.`, @@ -479,18 +525,21 @@ const unmarshalPrivateNetworkDHCPConfig = (data: unknown): PrivateNetworkDHCPCon } as PrivateNetworkDHCPConfig } -const unmarshalPrivateNetworkIpamConfig = (data: unknown): PrivateNetworkIpamConfig => { +const unmarshalPrivateNetworkIpamConfig = ( + data: unknown, +): PrivateNetworkIpamConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PrivateNetworkIpamConfig' failed as data isn't a dictionary.`, ) } - return { - } as PrivateNetworkIpamConfig + return {} as PrivateNetworkIpamConfig } -const unmarshalPrivateNetworkStaticConfig = (data: unknown): PrivateNetworkStaticConfig => { +const unmarshalPrivateNetworkStaticConfig = ( + data: unknown, +): PrivateNetworkStaticConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PrivateNetworkStaticConfig' failed as data isn't a dictionary.`, @@ -511,12 +560,18 @@ export const unmarshalPrivateNetwork = (data: unknown): PrivateNetwork => { return { createdAt: unmarshalDate(data.created_at), - dhcpConfig: data.dhcp_config ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) : undefined, - ipamConfig: data.ipam_config ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) : undefined, + dhcpConfig: data.dhcp_config + ? unmarshalPrivateNetworkDHCPConfig(data.dhcp_config) + : undefined, + ipamConfig: data.ipam_config + ? unmarshalPrivateNetworkIpamConfig(data.ipam_config) + : undefined, ipamIds: data.ipam_ids, lb: data.lb ? unmarshalLb(data.lb) : undefined, privateNetworkId: data.private_network_id, - staticConfig: data.static_config ? unmarshalPrivateNetworkStaticConfig(data.static_config) : undefined, + staticConfig: data.static_config + ? unmarshalPrivateNetworkStaticConfig(data.static_config) + : undefined, status: data.status, updatedAt: unmarshalDate(data.updated_at), } as PrivateNetwork @@ -554,7 +609,9 @@ export const unmarshalRoute = (data: unknown): Route => { } as Route } -export const unmarshalBackendServerStats = (data: unknown): BackendServerStats => { +export const unmarshalBackendServerStats = ( + data: unknown, +): BackendServerStats => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BackendServerStats' failed as data isn't a dictionary.`, @@ -579,7 +636,10 @@ export const unmarshalLbStats = (data: unknown): LbStats => { } return { - backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats), + backendServersStats: unmarshalArrayOfObject( + data.backend_servers_stats, + unmarshalBackendServerStats, + ), } as LbStats } @@ -596,7 +656,9 @@ export const unmarshalListAclResponse = (data: unknown): ListAclResponse => { } as ListAclResponse } -export const unmarshalListBackendStatsResponse = (data: unknown): ListBackendStatsResponse => { +export const unmarshalListBackendStatsResponse = ( + data: unknown, +): ListBackendStatsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBackendStatsResponse' failed as data isn't a dictionary.`, @@ -604,12 +666,17 @@ export const unmarshalListBackendStatsResponse = (data: unknown): ListBackendSta } return { - backendServersStats: unmarshalArrayOfObject(data.backend_servers_stats, unmarshalBackendServerStats), + backendServersStats: unmarshalArrayOfObject( + data.backend_servers_stats, + unmarshalBackendServerStats, + ), totalCount: data.total_count, } as ListBackendStatsResponse } -export const unmarshalListBackendsResponse = (data: unknown): ListBackendsResponse => { +export const unmarshalListBackendsResponse = ( + data: unknown, +): ListBackendsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBackendsResponse' failed as data isn't a dictionary.`, @@ -622,7 +689,9 @@ export const unmarshalListBackendsResponse = (data: unknown): ListBackendsRespon } as ListBackendsResponse } -export const unmarshalListCertificatesResponse = (data: unknown): ListCertificatesResponse => { +export const unmarshalListCertificatesResponse = ( + data: unknown, +): ListCertificatesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCertificatesResponse' failed as data isn't a dictionary.`, @@ -630,12 +699,17 @@ export const unmarshalListCertificatesResponse = (data: unknown): ListCertificat } return { - certificates: unmarshalArrayOfObject(data.certificates, unmarshalCertificate), + certificates: unmarshalArrayOfObject( + data.certificates, + unmarshalCertificate, + ), totalCount: data.total_count, } as ListCertificatesResponse } -export const unmarshalListFrontendsResponse = (data: unknown): ListFrontendsResponse => { +export const unmarshalListFrontendsResponse = ( + data: unknown, +): ListFrontendsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFrontendsResponse' failed as data isn't a dictionary.`, @@ -661,7 +735,9 @@ export const unmarshalListIpsResponse = (data: unknown): ListIpsResponse => { } as ListIpsResponse } -export const unmarshalListLbPrivateNetworksResponse = (data: unknown): ListLbPrivateNetworksResponse => { +export const unmarshalListLbPrivateNetworksResponse = ( + data: unknown, +): ListLbPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListLbPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -669,7 +745,10 @@ export const unmarshalListLbPrivateNetworksResponse = (data: unknown): ListLbPri } return { - privateNetwork: unmarshalArrayOfObject(data.private_network, unmarshalPrivateNetwork), + privateNetwork: unmarshalArrayOfObject( + data.private_network, + unmarshalPrivateNetwork, + ), totalCount: data.total_count, } as ListLbPrivateNetworksResponse } @@ -690,7 +769,9 @@ const unmarshalLbType = (data: unknown): LbType => { } as LbType } -export const unmarshalListLbTypesResponse = (data: unknown): ListLbTypesResponse => { +export const unmarshalListLbTypesResponse = ( + data: unknown, +): ListLbTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListLbTypesResponse' failed as data isn't a dictionary.`, @@ -716,7 +797,9 @@ export const unmarshalListLbsResponse = (data: unknown): ListLbsResponse => { } as ListLbsResponse } -export const unmarshalListRoutesResponse = (data: unknown): ListRoutesResponse => { +export const unmarshalListRoutesResponse = ( + data: unknown, +): ListRoutesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRoutesResponse' failed as data isn't a dictionary.`, @@ -729,7 +812,9 @@ export const unmarshalListRoutesResponse = (data: unknown): ListRoutesResponse = } as ListRoutesResponse } -export const unmarshalListSubscriberResponse = (data: unknown): ListSubscriberResponse => { +export const unmarshalListSubscriberResponse = ( + data: unknown, +): ListSubscriberResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSubscriberResponse' failed as data isn't a dictionary.`, @@ -772,8 +857,7 @@ const marshalPrivateNetworkDHCPConfig = ( const marshalPrivateNetworkIpamConfig = ( request: PrivateNetworkIpamConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalPrivateNetworkStaticConfig = ( request: PrivateNetworkStaticConfig, @@ -786,19 +870,28 @@ export const marshalAttachPrivateNetworkRequest = ( request: AttachPrivateNetworkRequest, defaults: DefaultValues, ): Record => ({ - ipam_ids: request.ipamIds, + ipam_ids: request.ipamIds, ...resolveOneOf([ - {param: 'static_config', - value: (request.staticConfig !== undefined) ? marshalPrivateNetworkStaticConfig(request.staticConfig, defaults) - : undefined, + { + param: 'static_config', + value: + request.staticConfig !== undefined + ? marshalPrivateNetworkStaticConfig(request.staticConfig, defaults) + : undefined, }, - {param: 'dhcp_config', - value: (request.dhcpConfig !== undefined) ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig, defaults) - : undefined, + { + param: 'dhcp_config', + value: + request.dhcpConfig !== undefined + ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig, defaults) + : undefined, }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalPrivateNetworkIpamConfig(request.ipamConfig, defaults) - : undefined, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalPrivateNetworkIpamConfig(request.ipamConfig, defaults) + : undefined, }, ]), }) @@ -816,7 +909,10 @@ const marshalAclAction = ( request: AclAction, defaults: DefaultValues, ): Record => ({ - redirect: ((request.redirect !== undefined) ? marshalAclActionRedirect(request.redirect, defaults): undefined), + redirect: + request.redirect !== undefined + ? marshalAclActionRedirect(request.redirect, defaults) + : undefined, type: request.type, }) @@ -836,10 +932,13 @@ export const marshalCreateAclRequest = ( request: CreateAclRequest, defaults: DefaultValues, ): Record => ({ - action: marshalAclAction(request.action, defaults), + action: marshalAclAction(request.action, defaults), description: request.description, index: request.index, - match: ((request.match !== undefined) ? marshalAclMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalAclMatch(request.match, defaults) + : undefined, name: request.name || randomName('acl'), }) @@ -867,8 +966,7 @@ const marshalHealthCheckHttpsConfig = ( const marshalHealthCheckLdapConfig = ( request: HealthCheckLdapConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalHealthCheckMysqlConfig = ( request: HealthCheckMysqlConfig, @@ -887,14 +985,12 @@ const marshalHealthCheckPgsqlConfig = ( const marshalHealthCheckRedisConfig = ( request: HealthCheckRedisConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalHealthCheckTcpConfig = ( request: HealthCheckTcpConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalHealthCheck = ( request: HealthCheck, @@ -905,35 +1001,56 @@ const marshalHealthCheck = ( check_send_proxy: request.checkSendProxy, check_timeout: request.checkTimeout, port: request.port, - transient_check_delay: request.transientCheckDelay, + transient_check_delay: request.transientCheckDelay, ...resolveOneOf([ - {param: 'tcp_config', - value: (request.tcpConfig !== undefined) ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) - : undefined, + { + param: 'tcp_config', + value: + request.tcpConfig !== undefined + ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) + : undefined, }, - {param: 'mysql_config', - value: (request.mysqlConfig !== undefined) ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) - : undefined, + { + param: 'mysql_config', + value: + request.mysqlConfig !== undefined + ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) + : undefined, }, - {param: 'pgsql_config', - value: (request.pgsqlConfig !== undefined) ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) - : undefined, + { + param: 'pgsql_config', + value: + request.pgsqlConfig !== undefined + ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) + : undefined, }, - {param: 'ldap_config', - value: (request.ldapConfig !== undefined) ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) - : undefined, + { + param: 'ldap_config', + value: + request.ldapConfig !== undefined + ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) + : undefined, }, - {param: 'redis_config', - value: (request.redisConfig !== undefined) ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) - : undefined, + { + param: 'redis_config', + value: + request.redisConfig !== undefined + ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) + : undefined, }, - {param: 'http_config', - value: (request.httpConfig !== undefined) ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) - : undefined, + { + param: 'http_config', + value: + request.httpConfig !== undefined + ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) + : undefined, }, - {param: 'https_config', - value: (request.httpsConfig !== undefined) ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) - : undefined, + { + param: 'https_config', + value: + request.httpsConfig !== undefined + ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) + : undefined, }, ]), }) @@ -946,7 +1063,7 @@ export const marshalCreateBackendRequest = ( forward_port: request.forwardPort, forward_port_algorithm: request.forwardPortAlgorithm, forward_protocol: request.forwardProtocol, - health_check: marshalHealthCheck(request.healthCheck, defaults), + health_check: marshalHealthCheck(request.healthCheck, defaults), ignore_ssl_server_verify: request.ignoreSslServerVerify, max_connections: request.maxConnections, max_retries: request.maxRetries, @@ -984,15 +1101,27 @@ export const marshalCreateCertificateRequest = ( request: CreateCertificateRequest, defaults: DefaultValues, ): Record => ({ - name: request.name || randomName('certificate'), + name: request.name || randomName('certificate'), ...resolveOneOf([ - {param: 'letsencrypt', - value: (request.letsencrypt !== undefined) ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt, defaults) - : undefined, + { + param: 'letsencrypt', + value: + request.letsencrypt !== undefined + ? marshalCreateCertificateRequestLetsencryptConfig( + request.letsencrypt, + defaults, + ) + : undefined, }, - {param: 'custom_certificate', - value: (request.customCertificate !== undefined) ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate, defaults) - : undefined, + { + param: 'custom_certificate', + value: + request.customCertificate !== undefined + ? marshalCreateCertificateRequestCustomCertificate( + request.customCertificate, + defaults, + ) + : undefined, }, ]), }) @@ -1018,12 +1147,16 @@ export const marshalCreateIpRequest = ( ): Record => ({ is_ipv6: request.isIpv6, reverse: request.reverse, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -1041,12 +1174,16 @@ export const marshalCreateLbRequest = ( name: request.name || randomName('lb'), ssl_compatibility_level: request.sslCompatibilityLevel, tags: request.tags, - type: request.type, + type: request.type, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -1056,17 +1193,11 @@ const marshalRouteMatch = ( request: RouteMatch, defaults: DefaultValues, ): Record => ({ - match_subdomains: request.matchSubdomains, + match_subdomains: request.matchSubdomains, ...resolveOneOf([ - {param: 'sni', - value: request.sni, - }, - {param: 'host_header', - value: request.hostHeader, - }, - {param: 'path_begin', - value: request.pathBegin, - }, + { param: 'sni', value: request.sni }, + { param: 'host_header', value: request.hostHeader }, + { param: 'path_begin', value: request.pathBegin }, ]), }) @@ -1076,7 +1207,10 @@ export const marshalCreateRouteRequest = ( ): Record => ({ backend_id: request.backendId, frontend_id: request.frontendId, - match: ((request.match !== undefined) ? marshalRouteMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalRouteMatch(request.match, defaults) + : undefined, }) const marshalSubscriberEmailConfig = ( @@ -1097,23 +1231,33 @@ export const marshalCreateSubscriberRequest = ( request: CreateSubscriberRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, - ]), + ]), ...resolveOneOf([ - {param: 'email_config', - value: (request.emailConfig !== undefined) ? marshalSubscriberEmailConfig(request.emailConfig, defaults) - : undefined, + { + param: 'email_config', + value: + request.emailConfig !== undefined + ? marshalSubscriberEmailConfig(request.emailConfig, defaults) + : undefined, }, - {param: 'webhook_config', - value: (request.webhookConfig !== undefined) ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) - : undefined, + { + param: 'webhook_config', + value: + request.webhookConfig !== undefined + ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) + : undefined, }, ]), }) @@ -1150,10 +1294,13 @@ export const marshalUpdateAclRequest = ( request: UpdateAclRequest, defaults: DefaultValues, ): Record => ({ - action: marshalAclAction(request.action, defaults), + action: marshalAclAction(request.action, defaults), description: request.description, index: request.index, - match: ((request.match !== undefined) ? marshalAclMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalAclMatch(request.match, defaults) + : undefined, name: request.name, }) @@ -1213,35 +1360,56 @@ export const marshalUpdateHealthCheckRequest = ( check_send_proxy: request.checkSendProxy, check_timeout: request.checkTimeout, port: request.port, - transient_check_delay: request.transientCheckDelay, + transient_check_delay: request.transientCheckDelay, ...resolveOneOf([ - {param: 'tcp_config', - value: (request.tcpConfig !== undefined) ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) - : undefined, + { + param: 'tcp_config', + value: + request.tcpConfig !== undefined + ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) + : undefined, }, - {param: 'mysql_config', - value: (request.mysqlConfig !== undefined) ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) - : undefined, + { + param: 'mysql_config', + value: + request.mysqlConfig !== undefined + ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) + : undefined, }, - {param: 'pgsql_config', - value: (request.pgsqlConfig !== undefined) ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) - : undefined, + { + param: 'pgsql_config', + value: + request.pgsqlConfig !== undefined + ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) + : undefined, }, - {param: 'ldap_config', - value: (request.ldapConfig !== undefined) ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) - : undefined, + { + param: 'ldap_config', + value: + request.ldapConfig !== undefined + ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) + : undefined, }, - {param: 'redis_config', - value: (request.redisConfig !== undefined) ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) - : undefined, + { + param: 'redis_config', + value: + request.redisConfig !== undefined + ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) + : undefined, }, - {param: 'http_config', - value: (request.httpConfig !== undefined) ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) - : undefined, + { + param: 'http_config', + value: + request.httpConfig !== undefined + ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) + : undefined, }, - {param: 'https_config', - value: (request.httpsConfig !== undefined) ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) - : undefined, + { + param: 'https_config', + value: + request.httpsConfig !== undefined + ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) + : undefined, }, ]), }) @@ -1270,22 +1438,31 @@ export const marshalUpdateRouteRequest = ( defaults: DefaultValues, ): Record => ({ backend_id: request.backendId, - match: ((request.match !== undefined) ? marshalRouteMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalRouteMatch(request.match, defaults) + : undefined, }) export const marshalUpdateSubscriberRequest = ( request: UpdateSubscriberRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'email_config', - value: (request.emailConfig !== undefined) ? marshalSubscriberEmailConfig(request.emailConfig, defaults) - : undefined, + { + param: 'email_config', + value: + request.emailConfig !== undefined + ? marshalSubscriberEmailConfig(request.emailConfig, defaults) + : undefined, }, - {param: 'webhook_config', - value: (request.webhookConfig !== undefined) ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) - : undefined, + { + param: 'webhook_config', + value: + request.webhookConfig !== undefined + ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) + : undefined, }, ]), }) @@ -1302,19 +1479,28 @@ export const marshalZonedApiAttachPrivateNetworkRequest = ( defaults: DefaultValues, ): Record => ({ ipam_ids: request.ipamIds, - private_network_id: request.privateNetworkId, + private_network_id: request.privateNetworkId, ...resolveOneOf([ - {param: 'static_config', - value: (request.staticConfig !== undefined) ? marshalPrivateNetworkStaticConfig(request.staticConfig, defaults) - : undefined, + { + param: 'static_config', + value: + request.staticConfig !== undefined + ? marshalPrivateNetworkStaticConfig(request.staticConfig, defaults) + : undefined, }, - {param: 'dhcp_config', - value: (request.dhcpConfig !== undefined) ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig, defaults) - : undefined, + { + param: 'dhcp_config', + value: + request.dhcpConfig !== undefined + ? marshalPrivateNetworkDHCPConfig(request.dhcpConfig, defaults) + : undefined, }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalPrivateNetworkIpamConfig(request.ipamConfig, defaults) - : undefined, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalPrivateNetworkIpamConfig(request.ipamConfig, defaults) + : undefined, }, ]), }) @@ -1323,10 +1509,13 @@ export const marshalZonedApiCreateAclRequest = ( request: ZonedApiCreateAclRequest, defaults: DefaultValues, ): Record => ({ - action: marshalAclAction(request.action, defaults), + action: marshalAclAction(request.action, defaults), description: request.description, index: request.index, - match: ((request.match !== undefined) ? marshalAclMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalAclMatch(request.match, defaults) + : undefined, name: request.name || randomName('acl'), }) @@ -1338,7 +1527,7 @@ export const marshalZonedApiCreateBackendRequest = ( forward_port: request.forwardPort, forward_port_algorithm: request.forwardPortAlgorithm, forward_protocol: request.forwardProtocol, - health_check: marshalHealthCheck(request.healthCheck, defaults), + health_check: marshalHealthCheck(request.healthCheck, defaults), ignore_ssl_server_verify: request.ignoreSslServerVerify, max_connections: request.maxConnections, max_retries: request.maxRetries, @@ -1361,15 +1550,27 @@ export const marshalZonedApiCreateCertificateRequest = ( request: ZonedApiCreateCertificateRequest, defaults: DefaultValues, ): Record => ({ - name: request.name || randomName('certificate'), + name: request.name || randomName('certificate'), ...resolveOneOf([ - {param: 'letsencrypt', - value: (request.letsencrypt !== undefined) ? marshalCreateCertificateRequestLetsencryptConfig(request.letsencrypt, defaults) - : undefined, + { + param: 'letsencrypt', + value: + request.letsencrypt !== undefined + ? marshalCreateCertificateRequestLetsencryptConfig( + request.letsencrypt, + defaults, + ) + : undefined, }, - {param: 'custom_certificate', - value: (request.customCertificate !== undefined) ? marshalCreateCertificateRequestCustomCertificate(request.customCertificate, defaults) - : undefined, + { + param: 'custom_certificate', + value: + request.customCertificate !== undefined + ? marshalCreateCertificateRequestCustomCertificate( + request.customCertificate, + defaults, + ) + : undefined, }, ]), }) @@ -1395,12 +1596,16 @@ export const marshalZonedApiCreateIpRequest = ( ): Record => ({ is_ipv6: request.isIpv6, reverse: request.reverse, - tags: request.tags, + tags: request.tags, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -1418,12 +1623,16 @@ export const marshalZonedApiCreateLbRequest = ( name: request.name || randomName('lb'), ssl_compatibility_level: request.sslCompatibilityLevel, tags: request.tags, - type: request.type, + type: request.type, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -1435,30 +1644,43 @@ export const marshalZonedApiCreateRouteRequest = ( ): Record => ({ backend_id: request.backendId, frontend_id: request.frontendId, - match: ((request.match !== undefined) ? marshalRouteMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalRouteMatch(request.match, defaults) + : undefined, }) export const marshalZonedApiCreateSubscriberRequest = ( request: ZonedApiCreateSubscriberRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, - ]), + ]), ...resolveOneOf([ - {param: 'email_config', - value: (request.emailConfig !== undefined) ? marshalSubscriberEmailConfig(request.emailConfig, defaults) - : undefined, + { + param: 'email_config', + value: + request.emailConfig !== undefined + ? marshalSubscriberEmailConfig(request.emailConfig, defaults) + : undefined, }, - {param: 'webhook_config', - value: (request.webhookConfig !== undefined) ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) - : undefined, + { + param: 'webhook_config', + value: + request.webhookConfig !== undefined + ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) + : undefined, }, ]), }) @@ -1488,10 +1710,13 @@ const marshalAclSpec = ( request: AclSpec, defaults: DefaultValues, ): Record => ({ - action: marshalAclAction(request.action, defaults), + action: marshalAclAction(request.action, defaults), description: request.description, index: request.index, - match: ((request.match !== undefined) ? marshalAclMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalAclMatch(request.match, defaults) + : undefined, name: request.name, }) @@ -1499,7 +1724,7 @@ export const marshalZonedApiSetAclsRequest = ( request: ZonedApiSetAclsRequest, defaults: DefaultValues, ): Record => ({ - acls: request.acls.map(elt => marshalAclSpec(elt, defaults)), + acls: request.acls.map(elt => marshalAclSpec(elt, defaults)), }) export const marshalZonedApiSetBackendServersRequest = ( @@ -1520,10 +1745,13 @@ export const marshalZonedApiUpdateAclRequest = ( request: ZonedApiUpdateAclRequest, defaults: DefaultValues, ): Record => ({ - action: marshalAclAction(request.action, defaults), + action: marshalAclAction(request.action, defaults), description: request.description, index: request.index, - match: ((request.match !== undefined) ? marshalAclMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalAclMatch(request.match, defaults) + : undefined, name: request.name, }) @@ -1583,35 +1811,56 @@ export const marshalZonedApiUpdateHealthCheckRequest = ( check_send_proxy: request.checkSendProxy, check_timeout: request.checkTimeout, port: request.port, - transient_check_delay: request.transientCheckDelay, + transient_check_delay: request.transientCheckDelay, ...resolveOneOf([ - {param: 'tcp_config', - value: (request.tcpConfig !== undefined) ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) - : undefined, + { + param: 'tcp_config', + value: + request.tcpConfig !== undefined + ? marshalHealthCheckTcpConfig(request.tcpConfig, defaults) + : undefined, }, - {param: 'mysql_config', - value: (request.mysqlConfig !== undefined) ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) - : undefined, + { + param: 'mysql_config', + value: + request.mysqlConfig !== undefined + ? marshalHealthCheckMysqlConfig(request.mysqlConfig, defaults) + : undefined, }, - {param: 'pgsql_config', - value: (request.pgsqlConfig !== undefined) ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) - : undefined, + { + param: 'pgsql_config', + value: + request.pgsqlConfig !== undefined + ? marshalHealthCheckPgsqlConfig(request.pgsqlConfig, defaults) + : undefined, }, - {param: 'ldap_config', - value: (request.ldapConfig !== undefined) ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) - : undefined, + { + param: 'ldap_config', + value: + request.ldapConfig !== undefined + ? marshalHealthCheckLdapConfig(request.ldapConfig, defaults) + : undefined, }, - {param: 'redis_config', - value: (request.redisConfig !== undefined) ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) - : undefined, + { + param: 'redis_config', + value: + request.redisConfig !== undefined + ? marshalHealthCheckRedisConfig(request.redisConfig, defaults) + : undefined, }, - {param: 'http_config', - value: (request.httpConfig !== undefined) ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) - : undefined, + { + param: 'http_config', + value: + request.httpConfig !== undefined + ? marshalHealthCheckHttpConfig(request.httpConfig, defaults) + : undefined, }, - {param: 'https_config', - value: (request.httpsConfig !== undefined) ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) - : undefined, + { + param: 'https_config', + value: + request.httpsConfig !== undefined + ? marshalHealthCheckHttpsConfig(request.httpsConfig, defaults) + : undefined, }, ]), }) @@ -1640,22 +1889,31 @@ export const marshalZonedApiUpdateRouteRequest = ( defaults: DefaultValues, ): Record => ({ backend_id: request.backendId, - match: ((request.match !== undefined) ? marshalRouteMatch(request.match, defaults): undefined), + match: + request.match !== undefined + ? marshalRouteMatch(request.match, defaults) + : undefined, }) export const marshalZonedApiUpdateSubscriberRequest = ( request: ZonedApiUpdateSubscriberRequest, defaults: DefaultValues, ): Record => ({ - name: request.name, + name: request.name, ...resolveOneOf([ - {param: 'email_config', - value: (request.emailConfig !== undefined) ? marshalSubscriberEmailConfig(request.emailConfig, defaults) - : undefined, + { + param: 'email_config', + value: + request.emailConfig !== undefined + ? marshalSubscriberEmailConfig(request.emailConfig, defaults) + : undefined, }, - {param: 'webhook_config', - value: (request.webhookConfig !== undefined) ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) - : undefined, + { + param: 'webhook_config', + value: + request.webhookConfig !== undefined + ? marshalSubscriberWebhookConfig(request.webhookConfig, defaults) + : undefined, }, ]), }) diff --git a/packages_generated/lb/src/v1/types.gen.ts b/packages_generated/lb/src/v1/types.gen.ts index 003eb8e95..e0a3cfbb6 100644 --- a/packages_generated/lb/src/v1/types.gen.ts +++ b/packages_generated/lb/src/v1/types.gen.ts @@ -1,16 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' +export type AclActionRedirectRedirectType = 'location' | 'scheme' -export type AclActionRedirectRedirectType = - | 'location' - | 'scheme' - -export type AclActionType = - | 'allow' - | 'deny' - | 'redirect' +export type AclActionType = 'allow' | 'deny' | 'redirect' export type AclHttpFilter = | 'acl_http_filter_none' @@ -32,19 +26,11 @@ export type BackendServerStatsServerState = | 'running' | 'stopping' -export type CertificateStatus = - | 'pending' - | 'ready' - | 'error' +export type CertificateStatus = 'pending' | 'ready' | 'error' -export type CertificateType = - | 'letsencryt' - | 'custom' +export type CertificateType = 'letsencryt' | 'custom' -export type ForwardPortAlgorithm = - | 'roundrobin' - | 'leastconn' - | 'first' +export type ForwardPortAlgorithm = 'roundrobin' | 'leastconn' | 'first' export type InstanceStatus = | 'unknown' @@ -68,11 +54,7 @@ export type LbStatus = | 'to_delete' | 'deleting' -export type LbTypeStock = - | 'unknown' - | 'low_stock' - | 'out_of_stock' - | 'available' +export type LbTypeStock = 'unknown' | 'low_stock' | 'out_of_stock' | 'available' export type ListAclRequestOrderBy = | 'created_at_asc' @@ -98,10 +80,7 @@ export type ListFrontendsRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListIpsRequestIpType = - | 'all' - | 'ipv4' - | 'ipv6' +export type ListIpsRequestIpType = 'all' | 'ipv4' | 'ipv6' export type ListLbsRequestOrderBy = | 'created_at_asc' @@ -113,9 +92,7 @@ export type ListPrivateNetworksRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListRoutesRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListRoutesRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListSubscriberRequestOrderBy = | 'created_at_asc' @@ -127,15 +104,9 @@ export type OnMarkedDownAction = | 'on_marked_down_action_none' | 'shutdown_sessions' -export type PrivateNetworkStatus = - | 'unknown' - | 'ready' - | 'pending' - | 'error' +export type PrivateNetworkStatus = 'unknown' | 'ready' | 'pending' | 'error' -export type Protocol = - | 'tcp' - | 'http' +export type Protocol = 'tcp' | 'http' export type ProxyProtocol = | 'proxy_protocol_unknown' @@ -151,10 +122,7 @@ export type SSLCompatibilityLevel = | 'ssl_compatibility_level_modern' | 'ssl_compatibility_level_old' -export type StickySessionsType = - | 'none' - | 'cookie' - | 'table' +export type StickySessionsType = 'none' | 'cookie' | 'table' export interface SubscriberEmailConfig { /** @@ -163,7 +131,6 @@ export interface SubscriberEmailConfig { email: string } - /** * Webhook alert of subscriber. */ @@ -174,7 +141,6 @@ export interface SubscriberWebhookConfig { uri: string } - export interface HealthCheckHttpConfig { /** * The HTTP path to use when performing a health check on backend servers. @@ -194,7 +160,6 @@ export interface HealthCheckHttpConfig { hostHeader: string } - export interface HealthCheckHttpsConfig { /** * The HTTP path to use when performing a health check on backend servers. @@ -218,10 +183,7 @@ export interface HealthCheckHttpsConfig { sni: string } - -export interface HealthCheckLdapConfig { -} - +export interface HealthCheckLdapConfig {} export interface HealthCheckMysqlConfig { /** @@ -230,7 +192,6 @@ export interface HealthCheckMysqlConfig { user: string } - export interface HealthCheckPgsqlConfig { /** * PostgreSQL user to use for the health check. @@ -238,14 +199,9 @@ export interface HealthCheckPgsqlConfig { user: string } +export interface HealthCheckRedisConfig {} -export interface HealthCheckRedisConfig { -} - - -export interface HealthCheckTcpConfig { -} - +export interface HealthCheckTcpConfig {} export interface Instance { /** @@ -278,7 +234,6 @@ export interface Instance { zone: ScwZone } - export interface Ip { /** * IP address ID. @@ -318,7 +273,6 @@ export interface Ip { zone: ScwZone } - /** * Subscriber. */ @@ -345,7 +299,6 @@ export interface Subscriber { webhookConfig?: SubscriberWebhookConfig } - export interface HealthCheck { /** * Port to use for the backend server health check. @@ -415,7 +368,6 @@ export interface HealthCheck { transientCheckDelay?: string } - export interface Lb { /** * Underlying Instance ID. @@ -499,7 +451,6 @@ export interface Lb { zone: ScwZone } - export interface AclActionRedirect { /** * Redirect type. @@ -515,7 +466,6 @@ export interface AclActionRedirect { code?: number } - export interface Backend { /** * Backend ID. @@ -619,7 +569,6 @@ export interface Backend { timeoutQueue?: string } - export interface Certificate { /** * Certificate type (Let's Encrypt or custom). @@ -675,7 +624,6 @@ export interface Certificate { statusDetails?: string } - export interface AclAction { /** * Action to take when incoming traffic matches an ACL filter. @@ -687,7 +635,6 @@ export interface AclAction { redirect?: AclActionRedirect } - export interface AclMatch { /** * List of IPs or CIDR v4/v6 addresses to filter for from the client side. @@ -715,7 +662,6 @@ export interface AclMatch { invert: boolean } - export interface Frontend { /** * Frontend ID. @@ -771,18 +717,14 @@ export interface Frontend { enableAccessLogs: boolean } - export interface PrivateNetworkDHCPConfig { /** - * @deprecated + * @deprecated */ ipId?: string } - -export interface PrivateNetworkIpamConfig { -} - +export interface PrivateNetworkIpamConfig {} export interface PrivateNetworkStaticConfig { /** @@ -791,7 +733,6 @@ export interface PrivateNetworkStaticConfig { ipAddress?: string[] } - export interface RouteMatch { /** * Value to match in the Server Name Indication TLS extension (SNI) field from an incoming connection made via an SSL/TLS transport layer. This field should be set for routes on TCP Load Balancers. @@ -817,7 +758,6 @@ export interface RouteMatch { pathBegin?: string } - export interface CreateCertificateRequestCustomCertificate { /** * Full PEM-formatted certificate, consisting of the entire certificate chain including public key, private key, and (optionally) Certificate Authorities. @@ -825,7 +765,6 @@ export interface CreateCertificateRequestCustomCertificate { certificateChain: string } - export interface CreateCertificateRequestLetsencryptConfig { /** * Main domain name of certificate (this domain must exist and resolve to your Load Balancer IP address). @@ -837,7 +776,6 @@ export interface CreateCertificateRequestLetsencryptConfig { subjectAlternativeName: string[] } - export interface BackendServerStats { /** * ID of your Load Balancer's underlying Instance. @@ -865,7 +803,6 @@ export interface BackendServerStats { lastHealthCheckStatus: BackendServerStatsHealthCheckStatus } - export interface Acl { /** * ACL ID. @@ -905,7 +842,6 @@ export interface Acl { description: string } - export interface PrivateNetwork { /** * Load Balancer object which is attached to the Private Network. @@ -951,7 +887,6 @@ export interface PrivateNetwork { updatedAt?: Date } - export interface LbType { /** * Load Balancer commercial offer type name. @@ -975,7 +910,6 @@ export interface LbType { zone: ScwZone } - export interface Route { /** * Route ID. @@ -1003,7 +937,6 @@ export interface Route { updatedAt?: Date } - export interface AclSpec { /** * ACL name. @@ -1027,7 +960,6 @@ export interface AclSpec { description: string } - export type AddBackendServersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1043,7 +975,6 @@ export type AddBackendServersRequest = { serverIp: string[] } - export type AttachPrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1081,7 +1012,6 @@ export type AttachPrivateNetworkRequest = { ipamIds?: string[] } - /** * Add an ACL to a Load Balancer frontend. */ @@ -1116,7 +1046,6 @@ export type CreateAclRequest = { description: string } - export type CreateBackendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1212,7 +1141,6 @@ export type CreateBackendRequest = { timeoutQueue?: string } - export type CreateCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1240,7 +1168,6 @@ export type CreateCertificateRequest = { customCertificate?: CreateCertificateRequestCustomCertificate } - export type CreateFrontendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1288,7 +1215,6 @@ export type CreateFrontendRequest = { enableAccessLogs: boolean } - export type CreateIpRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1320,7 +1246,6 @@ export type CreateIpRequest = { tags?: string[] } - export type CreateLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1376,7 +1301,6 @@ export type CreateLbRequest = { sslCompatibilityLevel?: SSLCompatibilityLevel } - export type CreateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1396,7 +1320,6 @@ export type CreateRouteRequest = { match?: RouteMatch } - /** * Create a new alert subscriber (webhook or email). */ @@ -1435,7 +1358,6 @@ export type CreateSubscriberRequest = { projectId?: string } - export type DeleteAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1447,7 +1369,6 @@ export type DeleteAclRequest = { aclId: string } - export type DeleteBackendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1459,7 +1380,6 @@ export type DeleteBackendRequest = { backendId: string } - export type DeleteCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1471,7 +1391,6 @@ export type DeleteCertificateRequest = { certificateId: string } - export type DeleteFrontendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1483,7 +1402,6 @@ export type DeleteFrontendRequest = { frontendId: string } - export type DeleteLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1499,7 +1417,6 @@ export type DeleteLbRequest = { releaseIp: boolean } - export type DeleteRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1511,7 +1428,6 @@ export type DeleteRouteRequest = { routeId: string } - export type DeleteSubscriberRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1523,7 +1439,6 @@ export type DeleteSubscriberRequest = { subscriberId: string } - export type DetachPrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1539,7 +1454,6 @@ export type DetachPrivateNetworkRequest = { privateNetworkId: string } - export type GetAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1551,7 +1465,6 @@ export type GetAclRequest = { aclId: string } - export type GetBackendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1563,7 +1476,6 @@ export type GetBackendRequest = { backendId: string } - export type GetCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1575,7 +1487,6 @@ export type GetCertificateRequest = { certificateId: string } - export type GetFrontendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1587,7 +1498,6 @@ export type GetFrontendRequest = { frontendId: string } - export type GetIpRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1599,7 +1509,6 @@ export type GetIpRequest = { ipId: string } - export type GetLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1611,7 +1520,6 @@ export type GetLbRequest = { lbId: string } - /** * Get Load Balancer stats. */ @@ -1630,7 +1538,6 @@ export type GetLbStatsRequest = { backendId?: string } - export type GetRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1642,7 +1549,6 @@ export type GetRouteRequest = { routeId: string } - export type GetSubscriberRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1654,7 +1560,6 @@ export type GetSubscriberRequest = { subscriberId: string } - export interface LbStats { /** * List of objects containing Load Balancer statistics. @@ -1662,7 +1567,6 @@ export interface LbStats { backendServersStats: BackendServerStats[] } - export interface ListAclResponse { /** * List of ACL objects. @@ -1674,7 +1578,6 @@ export interface ListAclResponse { totalCount: number } - export type ListAclsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1702,7 +1605,6 @@ export type ListAclsRequest = { name?: string } - export type ListBackendStatsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1726,7 +1628,6 @@ export type ListBackendStatsRequest = { backendId?: string } - export interface ListBackendStatsResponse { /** * List of objects containing backend server statistics. @@ -1738,7 +1639,6 @@ export interface ListBackendStatsResponse { totalCount: number } - export type ListBackendsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1766,7 +1666,6 @@ export type ListBackendsRequest = { pageSize?: number } - export interface ListBackendsResponse { /** * List of backend objects of a given Load Balancer. @@ -1778,7 +1677,6 @@ export interface ListBackendsResponse { totalCount: number } - export type ListCertificatesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1806,7 +1704,6 @@ export type ListCertificatesRequest = { name?: string } - export interface ListCertificatesResponse { /** * List of certificate objects. @@ -1818,7 +1715,6 @@ export interface ListCertificatesResponse { totalCount: number } - export type ListFrontendsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1846,7 +1742,6 @@ export type ListFrontendsRequest = { pageSize?: number } - export interface ListFrontendsResponse { /** * List of frontend objects of a given Load Balancer. @@ -1858,7 +1753,6 @@ export interface ListFrontendsResponse { totalCount: number } - export type ListIPsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1894,7 +1788,6 @@ export type ListIPsRequest = { tags?: string[] } - export interface ListIpsResponse { /** * List of IP address objects. @@ -1906,7 +1799,6 @@ export interface ListIpsResponse { totalCount: number } - export type ListLbPrivateNetworksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1930,7 +1822,6 @@ export type ListLbPrivateNetworksRequest = { page?: number } - export interface ListLbPrivateNetworksResponse { /** * List of Private Network objects attached to the Load Balancer. @@ -1942,7 +1833,6 @@ export interface ListLbPrivateNetworksResponse { totalCount: number } - export type ListLbTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1958,7 +1848,6 @@ export type ListLbTypesRequest = { pageSize?: number } - export interface ListLbTypesResponse { /** * List of Load Balancer commercial offer type objects. @@ -1970,7 +1859,6 @@ export interface ListLbTypesResponse { totalCount: number } - export type ListLbsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2006,7 +1894,6 @@ export type ListLbsRequest = { tags?: string[] } - export interface ListLbsResponse { /** * List of Load Balancer objects. @@ -2018,7 +1905,6 @@ export interface ListLbsResponse { totalCount: number } - export type ListRoutesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2042,7 +1928,6 @@ export type ListRoutesRequest = { frontendId?: string } - export interface ListRoutesResponse { /** * List of route objects. @@ -2054,7 +1939,6 @@ export interface ListRoutesResponse { totalCount: number } - export type ListSubscriberRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2086,7 +1970,6 @@ export type ListSubscriberRequest = { projectId?: string } - export interface ListSubscriberResponse { /** * List of subscriber objects. @@ -2098,7 +1981,6 @@ export interface ListSubscriberResponse { totalCount: number } - export type MigrateLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2114,7 +1996,6 @@ export type MigrateLbRequest = { type: string } - export type ReleaseIpRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2126,7 +2007,6 @@ export type ReleaseIpRequest = { ipId: string } - export type RemoveBackendServersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2142,7 +2022,6 @@ export type RemoveBackendServersRequest = { serverIp: string[] } - export interface SetAclsResponse { /** * List of ACL objects. @@ -2154,7 +2033,6 @@ export interface SetAclsResponse { totalCount: number } - export type SetBackendServersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2170,7 +2048,6 @@ export type SetBackendServersRequest = { serverIp: string[] } - export type SubscribeToLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2186,7 +2063,6 @@ export type SubscribeToLbRequest = { subscriberId: string } - export type UnsubscribeFromLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2198,7 +2074,6 @@ export type UnsubscribeFromLbRequest = { lbId: string } - export type UpdateAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2230,7 +2105,6 @@ export type UpdateAclRequest = { description?: string } - export type UpdateBackendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2318,7 +2192,6 @@ export type UpdateBackendRequest = { timeoutQueue?: string } - export type UpdateCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2334,7 +2207,6 @@ export type UpdateCertificateRequest = { name: string } - export type UpdateFrontendRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2382,7 +2254,6 @@ export type UpdateFrontendRequest = { enableAccessLogs?: boolean } - export type UpdateHealthCheckRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2460,7 +2331,6 @@ export type UpdateHealthCheckRequest = { transientCheckDelay?: string } - export type UpdateIpRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2484,7 +2354,6 @@ export type UpdateIpRequest = { tags?: string[] } - export type UpdateLbRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2512,7 +2381,6 @@ export type UpdateLbRequest = { sslCompatibilityLevel?: SSLCompatibilityLevel } - export type UpdateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2532,7 +2400,6 @@ export type UpdateRouteRequest = { match?: RouteMatch } - export type UpdateSubscriberRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2560,7 +2427,6 @@ export type UpdateSubscriberRequest = { webhookConfig?: SubscriberWebhookConfig } - export type ZonedApiAddBackendServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2576,7 +2442,6 @@ export type ZonedApiAddBackendServersRequest = { serverIp: string[] } - export type ZonedApiAttachPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2614,7 +2479,6 @@ export type ZonedApiAttachPrivateNetworkRequest = { ipamIds?: string[] } - /** * Add an ACL to a Load Balancer frontend. */ @@ -2649,7 +2513,6 @@ export type ZonedApiCreateAclRequest = { description: string } - export type ZonedApiCreateBackendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2745,7 +2608,6 @@ export type ZonedApiCreateBackendRequest = { timeoutQueue?: string } - export type ZonedApiCreateCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2773,7 +2635,6 @@ export type ZonedApiCreateCertificateRequest = { customCertificate?: CreateCertificateRequestCustomCertificate } - export type ZonedApiCreateFrontendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2821,7 +2682,6 @@ export type ZonedApiCreateFrontendRequest = { enableAccessLogs: boolean } - export type ZonedApiCreateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2853,7 +2713,6 @@ export type ZonedApiCreateIpRequest = { tags?: string[] } - export type ZonedApiCreateLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2909,7 +2768,6 @@ export type ZonedApiCreateLbRequest = { sslCompatibilityLevel?: SSLCompatibilityLevel } - export type ZonedApiCreateRouteRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2929,7 +2787,6 @@ export type ZonedApiCreateRouteRequest = { match?: RouteMatch } - /** * Create a new alert subscriber (webhook or email). */ @@ -2968,7 +2825,6 @@ export type ZonedApiCreateSubscriberRequest = { projectId?: string } - export type ZonedApiDeleteAclRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2980,7 +2836,6 @@ export type ZonedApiDeleteAclRequest = { aclId: string } - export type ZonedApiDeleteBackendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -2992,7 +2847,6 @@ export type ZonedApiDeleteBackendRequest = { backendId: string } - export type ZonedApiDeleteCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3004,7 +2858,6 @@ export type ZonedApiDeleteCertificateRequest = { certificateId: string } - export type ZonedApiDeleteFrontendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3016,7 +2869,6 @@ export type ZonedApiDeleteFrontendRequest = { frontendId: string } - export type ZonedApiDeleteLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3032,7 +2884,6 @@ export type ZonedApiDeleteLbRequest = { releaseIp: boolean } - export type ZonedApiDeleteRouteRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3044,7 +2895,6 @@ export type ZonedApiDeleteRouteRequest = { routeId: string } - export type ZonedApiDeleteSubscriberRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3056,7 +2906,6 @@ export type ZonedApiDeleteSubscriberRequest = { subscriberId: string } - export type ZonedApiDetachPrivateNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3072,7 +2921,6 @@ export type ZonedApiDetachPrivateNetworkRequest = { privateNetworkId: string } - export type ZonedApiGetAclRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3084,7 +2932,6 @@ export type ZonedApiGetAclRequest = { aclId: string } - export type ZonedApiGetBackendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3096,7 +2943,6 @@ export type ZonedApiGetBackendRequest = { backendId: string } - export type ZonedApiGetCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3108,7 +2954,6 @@ export type ZonedApiGetCertificateRequest = { certificateId: string } - export type ZonedApiGetFrontendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3120,7 +2965,6 @@ export type ZonedApiGetFrontendRequest = { frontendId: string } - export type ZonedApiGetIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3132,7 +2976,6 @@ export type ZonedApiGetIpRequest = { ipId: string } - export type ZonedApiGetLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3144,7 +2987,6 @@ export type ZonedApiGetLbRequest = { lbId: string } - /** * Get Load Balancer stats. */ @@ -3163,7 +3005,6 @@ export type ZonedApiGetLbStatsRequest = { backendId?: string } - export type ZonedApiGetRouteRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3175,7 +3016,6 @@ export type ZonedApiGetRouteRequest = { routeId: string } - export type ZonedApiGetSubscriberRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3187,7 +3027,6 @@ export type ZonedApiGetSubscriberRequest = { subscriberId: string } - export type ZonedApiListAclsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3215,7 +3054,6 @@ export type ZonedApiListAclsRequest = { name?: string } - export type ZonedApiListBackendStatsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3239,7 +3077,6 @@ export type ZonedApiListBackendStatsRequest = { backendId?: string } - export type ZonedApiListBackendsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3267,7 +3104,6 @@ export type ZonedApiListBackendsRequest = { pageSize?: number } - export type ZonedApiListCertificatesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3295,7 +3131,6 @@ export type ZonedApiListCertificatesRequest = { name?: string } - export type ZonedApiListFrontendsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3323,7 +3158,6 @@ export type ZonedApiListFrontendsRequest = { pageSize?: number } - export type ZonedApiListIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3359,7 +3193,6 @@ export type ZonedApiListIPsRequest = { tags?: string[] } - export type ZonedApiListLbPrivateNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3383,7 +3216,6 @@ export type ZonedApiListLbPrivateNetworksRequest = { page?: number } - export type ZonedApiListLbTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3399,7 +3231,6 @@ export type ZonedApiListLbTypesRequest = { pageSize?: number } - export type ZonedApiListLbsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3435,7 +3266,6 @@ export type ZonedApiListLbsRequest = { tags?: string[] } - export type ZonedApiListRoutesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3459,7 +3289,6 @@ export type ZonedApiListRoutesRequest = { frontendId?: string } - export type ZonedApiListSubscriberRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3491,7 +3320,6 @@ export type ZonedApiListSubscriberRequest = { projectId?: string } - export type ZonedApiMigrateLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3507,7 +3335,6 @@ export type ZonedApiMigrateLbRequest = { type: string } - export type ZonedApiReleaseIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3519,7 +3346,6 @@ export type ZonedApiReleaseIpRequest = { ipId: string } - export type ZonedApiRemoveBackendServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3535,7 +3361,6 @@ export type ZonedApiRemoveBackendServersRequest = { serverIp: string[] } - export type ZonedApiSetAclsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3551,7 +3376,6 @@ export type ZonedApiSetAclsRequest = { acls: AclSpec[] } - export type ZonedApiSetBackendServersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3567,7 +3391,6 @@ export type ZonedApiSetBackendServersRequest = { serverIp: string[] } - export type ZonedApiSubscribeToLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3583,7 +3406,6 @@ export type ZonedApiSubscribeToLbRequest = { subscriberId: string } - export type ZonedApiUnsubscribeFromLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3595,7 +3417,6 @@ export type ZonedApiUnsubscribeFromLbRequest = { lbId: string } - export type ZonedApiUpdateAclRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3627,7 +3448,6 @@ export type ZonedApiUpdateAclRequest = { description?: string } - export type ZonedApiUpdateBackendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3715,7 +3535,6 @@ export type ZonedApiUpdateBackendRequest = { timeoutQueue?: string } - export type ZonedApiUpdateCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3731,7 +3550,6 @@ export type ZonedApiUpdateCertificateRequest = { name: string } - export type ZonedApiUpdateFrontendRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3779,7 +3597,6 @@ export type ZonedApiUpdateFrontendRequest = { enableAccessLogs?: boolean } - export type ZonedApiUpdateHealthCheckRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3857,7 +3674,6 @@ export type ZonedApiUpdateHealthCheckRequest = { transientCheckDelay?: string } - export type ZonedApiUpdateIpRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3881,7 +3697,6 @@ export type ZonedApiUpdateIpRequest = { tags?: string[] } - export type ZonedApiUpdateLbRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3909,7 +3724,6 @@ export type ZonedApiUpdateLbRequest = { sslCompatibilityLevel?: SSLCompatibilityLevel } - export type ZonedApiUpdateRouteRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3929,7 +3743,6 @@ export type ZonedApiUpdateRouteRequest = { match?: RouteMatch } - export type ZonedApiUpdateSubscriberRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -3956,5 +3769,3 @@ export type ZonedApiUpdateSubscriberRequest = { */ webhookConfig?: SubscriberWebhookConfig } - - diff --git a/packages_generated/marketplace/src/v2/api.gen.ts b/packages_generated/marketplace/src/v2/api.gen.ts index 8b307a067..786b8943d 100644 --- a/packages_generated/marketplace/src/v2/api.gen.ts +++ b/packages_generated/marketplace/src/v2/api.gen.ts @@ -53,12 +53,15 @@ export class API extends ParentAPI { ['include_eol', request.includeEol], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListImagesResponse, ) - + /** * List marketplace images. List all available images on the marketplace, their UUID, CPU architecture and description. * @@ -68,7 +71,6 @@ export class API extends ParentAPI { listImages = (request: Readonly) => enrichForPagination('images', this.pageOfListImages, request) - /** * Get a specific marketplace image. Get detailed information about a marketplace image, specified by its `image_id` (UUID format). * @@ -84,7 +86,6 @@ export class API extends ParentAPI { unmarshalImage, ) - protected pageOfListVersions = (request: Readonly) => this.client.fetch( { @@ -94,12 +95,15 @@ export class API extends ParentAPI { ['image_id', request.imageId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListVersionsResponse, ) - + /** * List versions of an Image. Get a list of all available version of an image, specified by its `image_id` (UUID format). * @@ -109,7 +113,6 @@ export class API extends ParentAPI { listVersions = (request: Readonly) => enrichForPagination('versions', this.pageOfListVersions, request) - /** * Get a specific image version. Get information such as the name, creation date, last update and published date for an image version specified by its `version_id` (UUID format). * @@ -125,8 +128,9 @@ export class API extends ParentAPI { unmarshalVersion, ) - - protected pageOfListLocalImages = (request: Readonly = {}) => + protected pageOfListLocalImages = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -135,25 +139,24 @@ export class API extends ParentAPI { ['arch', request.arch], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['type', request.type], - ['zone', request.zone], - ...Object.entries(resolveOneOf([ - {param: 'image_id', - value: request.imageId, - }, - {param: 'version_id', - value: request.versionId, - }, - {param: 'image_label', - value: request.imageLabel, - }, - ])), + ['zone', request.zone], + ...Object.entries( + resolveOneOf([ + { param: 'image_id', value: request.imageId }, + { param: 'version_id', value: request.versionId }, + { param: 'image_label', value: request.imageLabel }, + ]), + ), ), }, unmarshalListLocalImagesResponse, ) - + /** * List local images from a specific image or version. List information about local images in a specific Availability Zone, specified by its `image_id` (UUID format), `version_id` (UUID format) or `image_label`. Only one of these three parameters may be set. * @@ -163,7 +166,6 @@ export class API extends ParentAPI { listLocalImages = (request: Readonly = {}) => enrichForPagination('localImages', this.pageOfListLocalImages, request) - /** * Get a specific local image by ID. Get detailed information about a local image, including compatible commercial types, supported architecture, labels and the Availability Zone of the image, specified by its `local_image_id` (UUID format). * @@ -179,20 +181,24 @@ export class API extends ParentAPI { unmarshalLocalImage, ) - - protected pageOfListCategories = (request: Readonly = {}) => + protected pageOfListCategories = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/marketplace/v2/categories`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListCategoriesResponse, ) - + /** * List existing image categories. Get a list of all existing categories. The output can be paginated. * @@ -202,7 +208,6 @@ export class API extends ParentAPI { listCategories = (request: Readonly = {}) => enrichForPagination('categories', this.pageOfListCategories, request) - /** * Get a specific category. Get information about a specific category of the marketplace catalog, specified by its `category_id` (UUID format). * @@ -217,7 +222,4 @@ export class API extends ParentAPI { }, unmarshalCategory, ) - - } - diff --git a/packages_generated/marketplace/src/v2/index.gen.ts b/packages_generated/marketplace/src/v2/index.gen.ts index 898c22ad4..fc530d006 100644 --- a/packages_generated/marketplace/src/v2/index.gen.ts +++ b/packages_generated/marketplace/src/v2/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { Category, diff --git a/packages_generated/marketplace/src/v2/marshalling.gen.ts b/packages_generated/marketplace/src/v2/marshalling.gen.ts index 697b41ebd..2763af77e 100644 --- a/packages_generated/marketplace/src/v2/marshalling.gen.ts +++ b/packages_generated/marketplace/src/v2/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { Category, Image, @@ -78,7 +81,9 @@ export const unmarshalVersion = (data: unknown): Version => { } as Version } -export const unmarshalListCategoriesResponse = (data: unknown): ListCategoriesResponse => { +export const unmarshalListCategoriesResponse = ( + data: unknown, +): ListCategoriesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCategoriesResponse' failed as data isn't a dictionary.`, @@ -91,7 +96,9 @@ export const unmarshalListCategoriesResponse = (data: unknown): ListCategoriesRe } as ListCategoriesResponse } -export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse => { +export const unmarshalListImagesResponse = ( + data: unknown, +): ListImagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`, @@ -104,7 +111,9 @@ export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse = } as ListImagesResponse } -export const unmarshalListLocalImagesResponse = (data: unknown): ListLocalImagesResponse => { +export const unmarshalListLocalImagesResponse = ( + data: unknown, +): ListLocalImagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListLocalImagesResponse' failed as data isn't a dictionary.`, @@ -117,7 +126,9 @@ export const unmarshalListLocalImagesResponse = (data: unknown): ListLocalImages } as ListLocalImagesResponse } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, diff --git a/packages_generated/marketplace/src/v2/types.gen.ts b/packages_generated/marketplace/src/v2/types.gen.ts index 4f4128503..c61e7e128 100644 --- a/packages_generated/marketplace/src/v2/types.gen.ts +++ b/packages_generated/marketplace/src/v2/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Zone as ScwZone } from '@scaleway/sdk-client' export type ListImagesRequestOrderBy = | 'name_asc' @@ -17,14 +16,9 @@ export type ListLocalImagesRequestOrderBy = | 'created_at_asc' | 'created_at_desc' -export type ListVersionsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListVersionsRequestOrderBy = 'created_at_asc' | 'created_at_desc' -export type LocalImageType = - | 'unknown_type' - | 'instance_local' - | 'instance_sbs' +export type LocalImageType = 'unknown_type' | 'instance_local' | 'instance_sbs' export interface Category { id: string @@ -32,7 +26,6 @@ export interface Category { description: string } - export interface Image { /** * UUID of this image. @@ -73,7 +66,6 @@ This label can be used in the image field of the server creation request. label: string } - export interface LocalImage { /** * Version you will typically use to define an image in an API call. @@ -101,7 +93,6 @@ export interface LocalImage { type: LocalImageType } - export interface Version { /** * UUID of this version. @@ -125,12 +116,10 @@ export interface Version { publishedAt?: Date } - export type GetCategoryRequest = { categoryId: string } - export type GetImageRequest = { /** * Display the image name. @@ -138,29 +127,24 @@ export type GetImageRequest = { imageId: string } - export type GetLocalImageRequest = { localImageId: string } - export type GetVersionRequest = { versionId: string } - export type ListCategoriesRequest = { pageSize?: number page?: number } - export interface ListCategoriesResponse { categories: Category[] totalCount: number } - export type ListImagesRequest = { /** * A positive integer lower or equal to 100 to select the number of items to display. @@ -188,13 +172,11 @@ export type ListImagesRequest = { includeEol: boolean } - export interface ListImagesResponse { images: Image[] totalCount: number } - export type ListLocalImagesRequest = { /** * A positive integer lower or equal to 100 to select the number of items to display. @@ -240,13 +222,11 @@ export type ListLocalImagesRequest = { type?: LocalImageType } - export interface ListLocalImagesResponse { localImages: LocalImage[] totalCount: number } - export type ListVersionsRequest = { imageId: string pageSize?: number @@ -254,10 +234,7 @@ export type ListVersionsRequest = { orderBy?: ListVersionsRequestOrderBy } - export interface ListVersionsResponse { versions: Version[] totalCount: number } - - diff --git a/packages_generated/mnq/src/v1beta1/api.gen.ts b/packages_generated/mnq/src/v1beta1/api.gen.ts index 281c6629d..0b33fd936 100644 --- a/packages_generated/mnq/src/v1beta1/api.gen.ts +++ b/packages_generated/mnq/src/v1beta1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { unmarshalListNatsAccountsResponse, unmarshalListNatsCredentialsResponse, @@ -83,21 +83,19 @@ export class NatsAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams'], + }) + /** * Create a NATS account. Create a NATS account associated with a Project. * * @param request - The request {@link NatsApiCreateNatsAccountRequest} * @returns A Promise of NatsAccount */ - createNatsAccount = (request: Readonly = {}) => + createNatsAccount = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( @@ -110,21 +108,17 @@ export class NatsAPI extends ParentAPI { unmarshalNatsAccount, ) - /** * Delete a NATS account. Delete a NATS account, specified by its NATS account ID. Note that deleting a NATS account is irreversible, and any credentials, streams, consumer and stored messages belonging to this NATS account will also be deleted. * * @param request - The request {@link NatsApiDeleteNatsAccountRequest} */ deleteNatsAccount = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-accounts/${validatePathParam('natsAccountId', request.natsAccountId)}`, + }) - /** * Update the name of a NATS account. Update the name of a NATS account, specified by its NATS account ID. * @@ -144,7 +138,6 @@ export class NatsAPI extends ParentAPI { unmarshalNatsAccount, ) - /** * Get a NATS account. Retrieve information about an existing NATS account identified by its NATS account ID. Its full details, including name and endpoint, are returned in the response. * @@ -160,8 +153,9 @@ export class NatsAPI extends ParentAPI { unmarshalNatsAccount, ) - - protected pageOfListNatsAccounts = (request: Readonly = {}) => + protected pageOfListNatsAccounts = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -169,13 +163,16 @@ export class NatsAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListNatsAccountsResponse, ) - + /** * List NATS accounts. List all NATS accounts in the specified region, for a Scaleway Organization or Project. By default, the NATS accounts returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -185,18 +182,22 @@ export class NatsAPI extends ParentAPI { listNatsAccounts = (request: Readonly = {}) => enrichForPagination('natsAccounts', this.pageOfListNatsAccounts, request) - /** * Create NATS credentials. Create a set of credentials for a NATS account, specified by its NATS account ID. * * @param request - The request {@link NatsApiCreateNatsCredentialsRequest} * @returns A Promise of NatsCredentials */ - createNatsCredentials = (request: Readonly) => + createNatsCredentials = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalNatsApiCreateNatsCredentialsRequest(request, this.client.settings), + marshalNatsApiCreateNatsCredentialsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -205,21 +206,19 @@ export class NatsAPI extends ParentAPI { unmarshalNatsCredentials, ) - /** * Delete NATS credentials. Delete a set of credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the NATS account, and active connections using this credentials will be closed. * * @param request - The request {@link NatsApiDeleteNatsCredentialsRequest} */ - deleteNatsCredentials = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}`, - }, - ) + deleteNatsCredentials = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/nats-credentials/${validatePathParam('natsCredentialsId', request.natsCredentialsId)}`, + }) - /** * Get NATS credentials. Retrieve an existing set of credentials, identified by the `nats_credentials_id`. The credentials themselves are NOT returned, only their metadata (NATS account ID, credentials name, etc), are returned in the response. * @@ -235,8 +234,9 @@ export class NatsAPI extends ParentAPI { unmarshalNatsCredentials, ) - - protected pageOfListNatsCredentials = (request: Readonly = {}) => + protected pageOfListNatsCredentials = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -245,23 +245,30 @@ export class NatsAPI extends ParentAPI { ['nats_account_id', request.natsAccountId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListNatsCredentialsResponse, ) - + /** * List NATS credentials. List existing credentials in the specified NATS account. The response contains only the metadata for the credentials, not the credentials themselves, which are only returned after a **Create Credentials** call. * * @param request - The request {@link NatsApiListNatsCredentialsRequest} * @returns A Promise of ListNatsCredentialsResponse */ - listNatsCredentials = (request: Readonly = {}) => - enrichForPagination('natsCredentials', this.pageOfListNatsCredentials, request) - - + listNatsCredentials = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'natsCredentials', + this.pageOfListNatsCredentials, + request, + ) } /** @@ -274,14 +281,10 @@ export class SnsAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams'], + }) + /** * Activate Topics and Events. Activate Topics and Events for the specified Project ID. Topics and Events must be activated before any usage. Activating Topics and Events does not trigger any billing, and you can deactivate at any time. * @@ -301,7 +304,6 @@ export class SnsAPI extends ParentAPI { unmarshalSnsInfo, ) - /** * Get Topics and Events info. Retrieve the Topics and Events information of the specified Project ID. information include the activation status and the Topics and Events API endpoint URL. * @@ -313,14 +315,14 @@ export class SnsAPI extends ParentAPI { { method: 'GET', path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-info`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalSnsInfo, ) - /** * Deactivate Topics and Events. Deactivate Topics and Events for the specified Project ID. You must delete all topics and credentials before this call or you need to set the force_delete parameter. * @@ -340,18 +342,22 @@ export class SnsAPI extends ParentAPI { unmarshalSnsInfo, ) - /** * Create Topics and Events credentials. Create a set of credentials for Topics and Events, specified by a Project ID. Credentials give the bearer access to topics, and the level of permissions can be defined granularly. * * @param request - The request {@link SnsApiCreateSnsCredentialsRequest} * @returns A Promise of SnsCredentials */ - createSnsCredentials = (request: Readonly = {}) => + createSnsCredentials = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalSnsApiCreateSnsCredentialsRequest(request, this.client.settings), + marshalSnsApiCreateSnsCredentialsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -360,32 +366,35 @@ export class SnsAPI extends ParentAPI { unmarshalSnsCredentials, ) - /** * Delete Topics and Events credentials. Delete a set of Topics and Events credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Topics and Events. * * @param request - The request {@link SnsApiDeleteSnsCredentialsRequest} */ - deleteSnsCredentials = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}`, - }, - ) + deleteSnsCredentials = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sns-credentials/${validatePathParam('snsCredentialsId', request.snsCredentialsId)}`, + }) - /** * Update Topics and Events credentials. Update a set of Topics and Events credentials. You can update the credentials' name, or their permissions. * * @param request - The request {@link SnsApiUpdateSnsCredentialsRequest} * @returns A Promise of SnsCredentials */ - updateSnsCredentials = (request: Readonly) => + updateSnsCredentials = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalSnsApiUpdateSnsCredentialsRequest(request, this.client.settings), + marshalSnsApiUpdateSnsCredentialsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -394,7 +403,6 @@ export class SnsAPI extends ParentAPI { unmarshalSnsCredentials, ) - /** * Get Topics and Events credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response. * @@ -410,8 +418,9 @@ export class SnsAPI extends ParentAPI { unmarshalSnsCredentials, ) - - protected pageOfListSnsCredentials = (request: Readonly = {}) => + protected pageOfListSnsCredentials = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -419,23 +428,30 @@ export class SnsAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSnsCredentialsResponse, ) - + /** * List Topics and Events credentials. List existing Topics and Events credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves. * * @param request - The request {@link SnsApiListSnsCredentialsRequest} * @returns A Promise of ListSnsCredentialsResponse */ - listSnsCredentials = (request: Readonly = {}) => - enrichForPagination('snsCredentials', this.pageOfListSnsCredentials, request) - - + listSnsCredentials = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'snsCredentials', + this.pageOfListSnsCredentials, + request, + ) } /** @@ -448,14 +464,10 @@ export class SqsAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams'], + }) + /** * Activate Queues. Activate Queues for the specified Project ID. Queues must be activated before any usage such as creating credentials and queues. Activating Queues does not trigger any billing, and you can deactivate at any time. * @@ -475,7 +487,6 @@ export class SqsAPI extends ParentAPI { unmarshalSqsInfo, ) - /** * Get Queues info. Retrieve the Queues information of the specified Project ID. information include the activation status and the Queues API endpoint URL. * @@ -487,14 +498,14 @@ export class SqsAPI extends ParentAPI { { method: 'GET', path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-info`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalSqsInfo, ) - /** * Deactivate Queues. Deactivate Queues for the specified Project ID. You must delete all queues and credentials before this call or you need to set the force_delete parameter. * @@ -514,18 +525,22 @@ export class SqsAPI extends ParentAPI { unmarshalSqsInfo, ) - /** * Create Queues credentials. Create a set of credentials for Queues, specified by a Project ID. Credentials give the bearer access to queues, and the level of permissions can be defined granularly. * * @param request - The request {@link SqsApiCreateSqsCredentialsRequest} * @returns A Promise of SqsCredentials */ - createSqsCredentials = (request: Readonly = {}) => + createSqsCredentials = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( - marshalSqsApiCreateSqsCredentialsRequest(request, this.client.settings), + marshalSqsApiCreateSqsCredentialsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -534,32 +549,35 @@ export class SqsAPI extends ParentAPI { unmarshalSqsCredentials, ) - /** * Delete Queues credentials. Delete a set of Queues credentials, specified by their credentials ID. Deleting credentials is irreversible and cannot be undone. The credentials can then no longer be used to access Queues. * * @param request - The request {@link SqsApiDeleteSqsCredentialsRequest} */ - deleteSqsCredentials = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}`, - }, - ) + deleteSqsCredentials = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/mnq/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/sqs-credentials/${validatePathParam('sqsCredentialsId', request.sqsCredentialsId)}`, + }) - /** * Update Queues credentials. Update a set of Queues credentials. You can update the credentials' name, or their permissions. * * @param request - The request {@link SqsApiUpdateSqsCredentialsRequest} * @returns A Promise of SqsCredentials */ - updateSqsCredentials = (request: Readonly) => + updateSqsCredentials = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalSqsApiUpdateSqsCredentialsRequest(request, this.client.settings), + marshalSqsApiUpdateSqsCredentialsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'PATCH', @@ -568,7 +586,6 @@ export class SqsAPI extends ParentAPI { unmarshalSqsCredentials, ) - /** * Get Queues credentials. Retrieve an existing set of credentials, identified by the `credentials_id`. The credentials themselves, as well as their metadata (name, project ID etc), are returned in the response. * @@ -584,8 +601,9 @@ export class SqsAPI extends ParentAPI { unmarshalSqsCredentials, ) - - protected pageOfListSqsCredentials = (request: Readonly = {}) => + protected pageOfListSqsCredentials = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -593,22 +611,28 @@ export class SqsAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSqsCredentialsResponse, ) - + /** * List Queues credentials. List existing Queues credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves. * * @param request - The request {@link SqsApiListSqsCredentialsRequest} * @returns A Promise of ListSqsCredentialsResponse */ - listSqsCredentials = (request: Readonly = {}) => - enrichForPagination('sqsCredentials', this.pageOfListSqsCredentials, request) - - + listSqsCredentials = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'sqsCredentials', + this.pageOfListSqsCredentials, + request, + ) } - diff --git a/packages_generated/mnq/src/v1beta1/marshalling.gen.ts b/packages_generated/mnq/src/v1beta1/marshalling.gen.ts index 7054e49e1..628439a69 100644 --- a/packages_generated/mnq/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/mnq/src/v1beta1/marshalling.gen.ts @@ -1,7 +1,11 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { NatsAccount, @@ -106,7 +110,9 @@ export const unmarshalSnsCredentials = (data: unknown): SnsCredentials => { createdAt: unmarshalDate(data.created_at), id: data.id, name: data.name, - permissions: data.permissions ? unmarshalSnsPermissions(data.permissions) : undefined, + permissions: data.permissions + ? unmarshalSnsPermissions(data.permissions) + : undefined, projectId: data.project_id, region: data.region, secretChecksum: data.secret_checksum, @@ -141,7 +147,9 @@ export const unmarshalSqsCredentials = (data: unknown): SqsCredentials => { createdAt: unmarshalDate(data.created_at), id: data.id, name: data.name, - permissions: data.permissions ? unmarshalSqsPermissions(data.permissions) : undefined, + permissions: data.permissions + ? unmarshalSqsPermissions(data.permissions) + : undefined, projectId: data.project_id, region: data.region, secretChecksum: data.secret_checksum, @@ -150,7 +158,9 @@ export const unmarshalSqsCredentials = (data: unknown): SqsCredentials => { } as SqsCredentials } -export const unmarshalListNatsAccountsResponse = (data: unknown): ListNatsAccountsResponse => { +export const unmarshalListNatsAccountsResponse = ( + data: unknown, +): ListNatsAccountsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNatsAccountsResponse' failed as data isn't a dictionary.`, @@ -158,12 +168,17 @@ export const unmarshalListNatsAccountsResponse = (data: unknown): ListNatsAccoun } return { - natsAccounts: unmarshalArrayOfObject(data.nats_accounts, unmarshalNatsAccount), + natsAccounts: unmarshalArrayOfObject( + data.nats_accounts, + unmarshalNatsAccount, + ), totalCount: data.total_count, } as ListNatsAccountsResponse } -export const unmarshalListNatsCredentialsResponse = (data: unknown): ListNatsCredentialsResponse => { +export const unmarshalListNatsCredentialsResponse = ( + data: unknown, +): ListNatsCredentialsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNatsCredentialsResponse' failed as data isn't a dictionary.`, @@ -171,12 +186,17 @@ export const unmarshalListNatsCredentialsResponse = (data: unknown): ListNatsCre } return { - natsCredentials: unmarshalArrayOfObject(data.nats_credentials, unmarshalNatsCredentials), + natsCredentials: unmarshalArrayOfObject( + data.nats_credentials, + unmarshalNatsCredentials, + ), totalCount: data.total_count, } as ListNatsCredentialsResponse } -export const unmarshalListSnsCredentialsResponse = (data: unknown): ListSnsCredentialsResponse => { +export const unmarshalListSnsCredentialsResponse = ( + data: unknown, +): ListSnsCredentialsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnsCredentialsResponse' failed as data isn't a dictionary.`, @@ -184,12 +204,17 @@ export const unmarshalListSnsCredentialsResponse = (data: unknown): ListSnsCrede } return { - snsCredentials: unmarshalArrayOfObject(data.sns_credentials, unmarshalSnsCredentials), + snsCredentials: unmarshalArrayOfObject( + data.sns_credentials, + unmarshalSnsCredentials, + ), totalCount: data.total_count, } as ListSnsCredentialsResponse } -export const unmarshalListSqsCredentialsResponse = (data: unknown): ListSqsCredentialsResponse => { +export const unmarshalListSqsCredentialsResponse = ( + data: unknown, +): ListSqsCredentialsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSqsCredentialsResponse' failed as data isn't a dictionary.`, @@ -197,7 +222,10 @@ export const unmarshalListSqsCredentialsResponse = (data: unknown): ListSqsCrede } return { - sqsCredentials: unmarshalArrayOfObject(data.sqs_credentials, unmarshalSqsCredentials), + sqsCredentials: unmarshalArrayOfObject( + data.sqs_credentials, + unmarshalSqsCredentials, + ), totalCount: data.total_count, } as ListSqsCredentialsResponse } @@ -280,7 +308,10 @@ export const marshalSnsApiCreateSnsCredentialsRequest = ( defaults: DefaultValues, ): Record => ({ name: request.name || randomName('mnq_sns'), - permissions: ((request.permissions !== undefined) ? marshalSnsPermissions(request.permissions, defaults): undefined), + permissions: + request.permissions !== undefined + ? marshalSnsPermissions(request.permissions, defaults) + : undefined, project_id: request.projectId ?? defaults.defaultProjectId, }) @@ -296,7 +327,10 @@ export const marshalSnsApiUpdateSnsCredentialsRequest = ( defaults: DefaultValues, ): Record => ({ name: request.name, - permissions: ((request.permissions !== undefined) ? marshalSnsPermissions(request.permissions, defaults): undefined), + permissions: + request.permissions !== undefined + ? marshalSnsPermissions(request.permissions, defaults) + : undefined, }) export const marshalSqsApiActivateSqsRequest = ( @@ -320,7 +354,10 @@ export const marshalSqsApiCreateSqsCredentialsRequest = ( defaults: DefaultValues, ): Record => ({ name: request.name || randomName('mnq_sqs'), - permissions: ((request.permissions !== undefined) ? marshalSqsPermissions(request.permissions, defaults): undefined), + permissions: + request.permissions !== undefined + ? marshalSqsPermissions(request.permissions, defaults) + : undefined, project_id: request.projectId ?? defaults.defaultProjectId, }) @@ -336,5 +373,8 @@ export const marshalSqsApiUpdateSqsCredentialsRequest = ( defaults: DefaultValues, ): Record => ({ name: request.name, - permissions: ((request.permissions !== undefined) ? marshalSqsPermissions(request.permissions, defaults): undefined), + permissions: + request.permissions !== undefined + ? marshalSqsPermissions(request.permissions, defaults) + : undefined, }) diff --git a/packages_generated/mnq/src/v1beta1/types.gen.ts b/packages_generated/mnq/src/v1beta1/types.gen.ts index 717388903..703c9bdb8 100644 --- a/packages_generated/mnq/src/v1beta1/types.gen.ts +++ b/packages_generated/mnq/src/v1beta1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type ListNatsAccountsRequestOrderBy = | 'created_at_asc' @@ -35,15 +34,9 @@ export type ListSqsCredentialsRequestOrderBy = | 'name_asc' | 'name_desc' -export type SnsInfoStatus = - | 'unknown_status' - | 'enabled' - | 'disabled' +export type SnsInfoStatus = 'unknown_status' | 'enabled' | 'disabled' -export type SqsInfoStatus = - | 'unknown_status' - | 'enabled' - | 'disabled' +export type SqsInfoStatus = 'unknown_status' | 'enabled' | 'disabled' export interface File { /** @@ -56,7 +49,6 @@ export interface File { content: string } - export interface SnsPermissions { /** * Defines whether the credentials bearer can publish messages to the service (publish to Topics and Events topics). @@ -72,7 +64,6 @@ export interface SnsPermissions { canManage?: boolean } - export interface SqsPermissions { /** * Defines whether the credentials bearer can publish messages to the service (send messages to Queues queues). @@ -88,7 +79,6 @@ export interface SqsPermissions { canManage?: boolean } - export interface NatsAccount { /** * NATS account ID. @@ -120,7 +110,6 @@ export interface NatsAccount { updatedAt?: Date } - export interface NatsCredentials { /** * ID of the credentials. @@ -156,7 +145,6 @@ export interface NatsCredentials { checksum: string } - export interface SnsCredentials { /** * ID of the credentials. @@ -200,7 +188,6 @@ export interface SnsCredentials { permissions?: SnsPermissions } - export interface SqsCredentials { /** * ID of the credentials. @@ -244,7 +231,6 @@ export interface SqsCredentials { permissions?: SqsPermissions } - export interface ListNatsAccountsResponse { /** * Total count of existing NATS accounts (matching any filters specified). @@ -256,7 +242,6 @@ export interface ListNatsAccountsResponse { natsAccounts: NatsAccount[] } - export interface ListNatsCredentialsResponse { /** * Total count of existing credentials (matching any filters specified). @@ -268,7 +253,6 @@ export interface ListNatsCredentialsResponse { natsCredentials: NatsCredentials[] } - export interface ListSnsCredentialsResponse { /** * Total count of existing credentials (matching any filters specified). @@ -280,7 +264,6 @@ export interface ListSnsCredentialsResponse { snsCredentials: SnsCredentials[] } - export interface ListSqsCredentialsResponse { /** * Total count of existing credentials (matching any filters specified). @@ -292,7 +275,6 @@ export interface ListSqsCredentialsResponse { sqsCredentials: SqsCredentials[] } - export type NatsApiCreateNatsAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -308,7 +290,6 @@ export type NatsApiCreateNatsAccountRequest = { projectId?: string } - export type NatsApiCreateNatsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -324,7 +305,6 @@ export type NatsApiCreateNatsCredentialsRequest = { name?: string } - export type NatsApiDeleteNatsAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -336,7 +316,6 @@ export type NatsApiDeleteNatsAccountRequest = { natsAccountId: string } - export type NatsApiDeleteNatsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -348,7 +327,6 @@ export type NatsApiDeleteNatsCredentialsRequest = { natsCredentialsId: string } - export type NatsApiGetNatsAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -360,7 +338,6 @@ export type NatsApiGetNatsAccountRequest = { natsAccountId: string } - export type NatsApiGetNatsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -372,7 +349,6 @@ export type NatsApiGetNatsCredentialsRequest = { natsCredentialsId: string } - export type NatsApiListNatsAccountsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -396,7 +372,6 @@ export type NatsApiListNatsAccountsRequest = { orderBy?: ListNatsAccountsRequestOrderBy } - export type NatsApiListNatsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -424,7 +399,6 @@ export type NatsApiListNatsCredentialsRequest = { orderBy?: ListNatsCredentialsRequestOrderBy } - export type NatsApiUpdateNatsAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -440,7 +414,6 @@ export type NatsApiUpdateNatsAccountRequest = { name?: string } - export type SnsApiActivateSnsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -452,7 +425,6 @@ export type SnsApiActivateSnsRequest = { projectId?: string } - export type SnsApiCreateSnsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -472,7 +444,6 @@ export type SnsApiCreateSnsCredentialsRequest = { permissions?: SnsPermissions } - export type SnsApiDeactivateSnsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -484,7 +455,6 @@ export type SnsApiDeactivateSnsRequest = { projectId?: string } - export type SnsApiDeleteSnsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -496,7 +466,6 @@ export type SnsApiDeleteSnsCredentialsRequest = { snsCredentialsId: string } - export type SnsApiGetSnsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -508,7 +477,6 @@ export type SnsApiGetSnsCredentialsRequest = { snsCredentialsId: string } - export type SnsApiGetSnsInfoRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -520,7 +488,6 @@ export type SnsApiGetSnsInfoRequest = { projectId?: string } - export type SnsApiListSnsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -544,7 +511,6 @@ export type SnsApiListSnsCredentialsRequest = { orderBy?: ListSnsCredentialsRequestOrderBy } - export type SnsApiUpdateSnsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -564,7 +530,6 @@ export type SnsApiUpdateSnsCredentialsRequest = { permissions?: SnsPermissions } - export interface SnsInfo { /** * Project ID of the Project containing the service. @@ -592,7 +557,6 @@ export interface SnsInfo { snsEndpointUrl: string } - export type SqsApiActivateSqsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -604,7 +568,6 @@ export type SqsApiActivateSqsRequest = { projectId?: string } - export type SqsApiCreateSqsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -624,7 +587,6 @@ export type SqsApiCreateSqsCredentialsRequest = { permissions?: SqsPermissions } - export type SqsApiDeactivateSqsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -636,7 +598,6 @@ export type SqsApiDeactivateSqsRequest = { projectId?: string } - export type SqsApiDeleteSqsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -648,7 +609,6 @@ export type SqsApiDeleteSqsCredentialsRequest = { sqsCredentialsId: string } - export type SqsApiGetSqsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -660,7 +620,6 @@ export type SqsApiGetSqsCredentialsRequest = { sqsCredentialsId: string } - export type SqsApiGetSqsInfoRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -672,7 +631,6 @@ export type SqsApiGetSqsInfoRequest = { projectId?: string } - export type SqsApiListSqsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -696,7 +654,6 @@ export type SqsApiListSqsCredentialsRequest = { orderBy?: ListSqsCredentialsRequestOrderBy } - export type SqsApiUpdateSqsCredentialsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -716,7 +673,6 @@ export type SqsApiUpdateSqsCredentialsRequest = { permissions?: SqsPermissions } - export interface SqsInfo { /** * Project ID of the Project containing the service. @@ -743,5 +699,3 @@ export interface SqsInfo { */ sqsEndpointUrl: string } - - diff --git a/packages_generated/mongodb/src/v1/api.gen.ts b/packages_generated/mongodb/src/v1/api.gen.ts index 4495dd34d..8e9c9fa86 100644 --- a/packages_generated/mongodb/src/v1/api.gen.ts +++ b/packages_generated/mongodb/src/v1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_MONGODB,SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_MONGODB,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_MONGODB, + SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_MONGODB, +} from './content.gen.js' import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, @@ -82,14 +85,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - - protected pageOfListNodeTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + + protected pageOfListNodeTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -97,12 +99,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['include_disabled', request.includeDisabled], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. * @@ -112,21 +117,25 @@ export class API extends ParentAPI { listNodeTypes = (request: Readonly = {}) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - protected pageOfListVersions = (request: Readonly = {}) => + protected pageOfListVersions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListVersionsResponse, ) - + /** * List available MongoDB® major versions. * @@ -136,8 +145,9 @@ export class API extends ParentAPI { listVersions = (request: Readonly = {}) => enrichForPagination('versions', this.pageOfListVersions, request) - - protected pageOfListInstances = (request: Readonly = {}) => + protected pageOfListInstances = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -147,14 +157,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListInstancesResponse, ) - + /** * List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -164,7 +177,6 @@ export class API extends ParentAPI { listInstances = (request: Readonly = {}) => enrichForPagination('instances', this.pageOfListInstances, request) - /** * Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object. * @@ -179,7 +191,7 @@ export class API extends ParentAPI { }, unmarshalInstance, ) - + /** * Waits for {@link Instance} to be in a final state. * @@ -192,13 +204,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES_MONGODB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !INSTANCE_TRANSIENT_STATUSES_MONGODB.includes(res.status), + )), this.getInstance, request, options, ) - /** * Create a MongoDB® Database Instance. Create a new MongoDB® Database Instance. * @@ -218,7 +233,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Update a MongoDB® Database Instance. Update the parameters of a MongoDB® Database Instance. * @@ -238,7 +252,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Delete a MongoDB® Database Instance. Delete a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. * @@ -254,7 +267,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Upgrade a Database Instance. Upgrade your current Database Instance specifications like volume size. * @@ -274,7 +286,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Get the certificate of a Database Instance. Retrieve the certificate of a given Database Instance, specified by the `instance_id` parameter. * @@ -282,18 +293,13 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ getInstanceCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the `name` and `instance_id` parameters in the request. * @@ -313,7 +319,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - /** * Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to retrieve. * @@ -328,7 +333,7 @@ export class API extends ParentAPI { }, unmarshalSnapshot, ) - + /** * Waits for {@link Snapshot} to be in a final state. * @@ -341,13 +346,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES_MONGODB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SNAPSHOT_TRANSIENT_STATUSES_MONGODB.includes(res.status), + )), this.getSnapshot, request, options, ) - /** * Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters. * @@ -367,7 +375,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - /** * Restore a Database Instance snapshot. Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to restore, the `instance_name` of the new Database Instance, `node_type` of the new Database Instance and `node_amount` of the new Database Instance. * @@ -387,8 +394,9 @@ export class API extends ParentAPI { unmarshalInstance, ) - - protected pageOfListSnapshots = (request: Readonly = {}) => + protected pageOfListSnapshots = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -399,13 +407,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSnapshotsResponse, ) - + /** * List snapshots. List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -415,7 +426,6 @@ export class API extends ParentAPI { listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to delete. * @@ -431,7 +441,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - protected pageOfListUsers = (request: Readonly) => this.client.fetch( { @@ -441,12 +450,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListUsersResponse, ) - + /** * List users of a Database Instance. List all users of a given Database Instance. * @@ -456,7 +468,6 @@ export class API extends ParentAPI { listUsers = (request: Readonly) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Create an user on a Database Instance. Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request. * @@ -476,7 +487,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the `password` parameter, but you cannot change the name of the user. * @@ -496,21 +506,17 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Delete a user on a Database Instance. Delete an existing user on a Database Instance. * * @param request - The request {@link DeleteUserRequest} */ deleteUser = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, + }) - /** * Apply user roles. Apply preset roles for a user in a Database Instance. * @@ -530,7 +536,6 @@ export class API extends ParentAPI { unmarshalUser, ) - protected pageOfListDatabases = (request: Readonly) => this.client.fetch( { @@ -539,12 +544,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDatabasesResponse, ) - + /** * List databases in a Database Instance. List all databases of a given Database Instance. * @@ -554,21 +562,17 @@ export class API extends ParentAPI { listDatabases = (request: Readonly) => enrichForPagination('databases', this.pageOfListDatabases, request) - /** * Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/mongodb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - /** * Create a new Instance endpoint. Create a new endpoint for a MongoDB® Database Instance. You can add `public_network` or `private_network` specifications to the body of the request. * @@ -587,7 +591,4 @@ export class API extends ParentAPI { }, unmarshalEndpoint, ) - - } - diff --git a/packages_generated/mongodb/src/v1/content.gen.ts b/packages_generated/mongodb/src/v1/content.gen.ts index 3d153296b..aba79fb49 100644 --- a/packages_generated/mongodb/src/v1/content.gen.ts +++ b/packages_generated/mongodb/src/v1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - InstanceStatus, - SnapshotStatus, -} from './types.gen.js' - +import type { InstanceStatus, SnapshotStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link InstanceStatus}. */ export const INSTANCE_TRANSIENT_STATUSES: InstanceStatus[] = [ @@ -21,4 +17,3 @@ export const SNAPSHOT_TRANSIENT_STATUSES: SnapshotStatus[] = [ 'restoring', 'deleting', ] - diff --git a/packages_generated/mongodb/src/v1/index.gen.ts b/packages_generated/mongodb/src/v1/index.gen.ts index 530903ce0..aaf4f84ca 100644 --- a/packages_generated/mongodb/src/v1/index.gen.ts +++ b/packages_generated/mongodb/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/mongodb/src/v1/marshalling.gen.ts b/packages_generated/mongodb/src/v1/marshalling.gen.ts index a89caca02..b075abece 100644 --- a/packages_generated/mongodb/src/v1/marshalling.gen.ts +++ b/packages_generated/mongodb/src/v1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointPrivateNetworkDetails, @@ -38,7 +43,9 @@ import type { UpgradeInstanceRequest, } from './types.gen.js' -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -50,15 +57,16 @@ const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateN } as EndpointPrivateNetworkDetails } -const unmarshalEndpointPublicNetworkDetails = (data: unknown): EndpointPublicNetworkDetails => { +const unmarshalEndpointPublicNetworkDetails = ( + data: unknown, +): EndpointPublicNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPublicNetworkDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointPublicNetworkDetails + return {} as EndpointPublicNetworkDetails } export const unmarshalEndpoint = (data: unknown): Endpoint => { @@ -72,12 +80,18 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { dnsRecord: data.dns_record, id: data.id, port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, - publicNetwork: data.public_network ? unmarshalEndpointPublicNetworkDetails(data.public_network) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, + publicNetwork: data.public_network + ? unmarshalEndpointPublicNetworkDetails(data.public_network) + : undefined, } as Endpoint } -const unmarshalInstanceSnapshotSchedule = (data: unknown): InstanceSnapshotSchedule => { +const unmarshalInstanceSnapshotSchedule = ( + data: unknown, +): InstanceSnapshotSchedule => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`, @@ -123,7 +137,9 @@ export const unmarshalInstance = (data: unknown): Instance => { organizationId: data.organization_id, projectId: data.project_id, region: data.region, - snapshotSchedule: data.snapshot_schedule ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) : undefined, + snapshotSchedule: data.snapshot_schedule + ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) + : undefined, status: data.status, tags: data.tags, version: data.version, @@ -193,7 +209,9 @@ const unmarshalDatabase = (data: unknown): Database => { } as Database } -export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResponse => { +export const unmarshalListDatabasesResponse = ( + data: unknown, +): ListDatabasesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`, @@ -206,7 +224,9 @@ export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResp } as ListDatabasesResponse } -export const unmarshalListInstancesResponse = (data: unknown): ListInstancesResponse => { +export const unmarshalListInstancesResponse = ( + data: unknown, +): ListInstancesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`, @@ -243,7 +263,10 @@ const unmarshalNodeType = (data: unknown): NodeType => { } return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType), + availableVolumeTypes: unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType, + ), beta: data.beta, description: data.description, disabled: data.disabled, @@ -255,7 +278,9 @@ const unmarshalNodeType = (data: unknown): NodeType => { } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -268,7 +293,9 @@ export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResp } as ListNodeTypesResponse } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -281,7 +308,9 @@ export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResp } as ListSnapshotsResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -307,7 +336,9 @@ const unmarshalVersion = (data: unknown): Version => { } as Version } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, @@ -330,21 +361,32 @@ const marshalEndpointSpecPrivateNetworkDetails = ( const marshalEndpointSpecPublicNetworkDetails = ( request: EndpointSpecPublicNetworkDetails, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'public_network', - value: (request.publicNetwork !== undefined) ? marshalEndpointSpecPublicNetworkDetails(request.publicNetwork, defaults) - : undefined, + { + param: 'public_network', + value: + request.publicNetwork !== undefined + ? marshalEndpointSpecPublicNetworkDetails( + request.publicNetwork, + defaults, + ) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkDetails( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -353,7 +395,7 @@ export const marshalCreateEndpointRequest = ( request: CreateEndpointRequest, defaults: DefaultValues, ): Record => ({ - endpoint: marshalEndpointSpec(request.endpoint, defaults), + endpoint: marshalEndpointSpec(request.endpoint, defaults), instance_id: request.instanceId, }) @@ -369,7 +411,10 @@ export const marshalCreateInstanceRequest = ( request: CreateInstanceRequest, defaults: DefaultValues, ): Record => ({ - endpoints: ((request.endpoints !== undefined) ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), + endpoints: + request.endpoints !== undefined + ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, name: request.name || randomName('mgdb'), node_amount: request.nodeAmount, node_type: request.nodeType, @@ -378,7 +423,10 @@ export const marshalCreateInstanceRequest = ( tags: request.tags, user_name: request.userName, version: request.version, - volume: ((request.volume !== undefined) ? marshalVolume(request.volume, defaults): undefined), + volume: + request.volume !== undefined + ? marshalVolume(request.volume, defaults) + : undefined, }) export const marshalCreateSnapshotRequest = ( @@ -412,14 +460,10 @@ const marshalUserRole = ( request: UserRole, defaults: DefaultValues, ): Record => ({ - role: request.role, + role: request.role, ...resolveOneOf([ - {param: 'database_name', - value: request.databaseName, - }, - {param: 'any_database', - value: request.anyDatabase, - }, + { param: 'database_name', value: request.databaseName }, + { param: 'any_database', value: request.anyDatabase }, ]), }) @@ -427,7 +471,10 @@ export const marshalSetUserRoleRequest = ( request: SetUserRoleRequest, defaults: DefaultValues, ): Record => ({ - roles: ((request.roles !== undefined) ? request.roles.map(elt => marshalUserRole(elt, defaults)): undefined), + roles: + request.roles !== undefined + ? request.roles.map(elt => marshalUserRole(elt, defaults)) + : undefined, user_name: request.userName, }) @@ -460,10 +507,8 @@ export const marshalUpdateUserRequest = ( export const marshalUpgradeInstanceRequest = ( request: UpgradeInstanceRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'volume_size_bytes', - value: request.volumeSizeBytes, - }, + { param: 'volume_size_bytes', value: request.volumeSizeBytes }, ]), }) diff --git a/packages_generated/mongodb/src/v1/types.gen.ts b/packages_generated/mongodb/src/v1/types.gen.ts index df063014d..f6b5504b6 100644 --- a/packages_generated/mongodb/src/v1/types.gen.ts +++ b/packages_generated/mongodb/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type InstanceStatus = | 'unknown_status' @@ -14,9 +13,7 @@ export type InstanceStatus = | 'locked' | 'snapshotting' -export type ListDatabasesRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListDatabasesRequestOrderBy = 'name_asc' | 'name_desc' export type ListInstancesRequestOrderBy = | 'created_at_asc' @@ -34,9 +31,7 @@ export type ListSnapshotsRequestOrderBy = | 'expires_at_asc' | 'expires_at_desc' -export type ListUsersRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListUsersRequestOrderBy = 'name_asc' | 'name_desc' export type NodeTypeStock = | 'unknown_stock' @@ -60,10 +55,7 @@ export type UserRoleRole = | 'db_admin' | 'sync' -export type VolumeType = - | 'unknown_type' - | 'sbs_5k' - | 'sbs_15k' +export type VolumeType = 'unknown_type' | 'sbs_5k' | 'sbs_15k' /** * Private Network details. @@ -75,13 +67,10 @@ export interface EndpointPrivateNetworkDetails { privateNetworkId: string } - /** * Public Access details. */ -export interface EndpointPublicNetworkDetails { -} - +export interface EndpointPublicNetworkDetails {} export interface EndpointSpecPrivateNetworkDetails { /** @@ -90,10 +79,7 @@ export interface EndpointSpecPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointSpecPublicNetworkDetails { -} - +export interface EndpointSpecPublicNetworkDetails {} export interface Endpoint { /** @@ -122,7 +108,6 @@ export interface Endpoint { publicNetwork?: EndpointPublicNetworkDetails } - export interface InstanceSnapshotSchedule { frequencyHours: number retentionDays: number @@ -131,7 +116,6 @@ export interface InstanceSnapshotSchedule { lastRun?: Date } - export interface Volume { /** * Type of volume where data is stored. @@ -143,7 +127,6 @@ export interface Volume { sizeBytes: number } - export interface NodeTypeVolumeType { /** * Volume Type. @@ -167,7 +150,6 @@ export interface NodeTypeVolumeType { chunkSizeBytes: number } - export interface UserRole { /** * Name of the preset role. @@ -187,7 +169,6 @@ export interface UserRole { anyDatabase?: boolean } - export interface EndpointSpec { /** * @@ -201,12 +182,10 @@ export interface EndpointSpec { privateNetwork?: EndpointSpecPrivateNetworkDetails } - export interface Database { name: string } - export interface Instance { /** * UUID of the Database Instance. @@ -266,7 +245,6 @@ export interface Instance { snapshotSchedule?: InstanceSnapshotSchedule } - export interface NodeType { /** * Node type name identifier. @@ -306,7 +284,6 @@ export interface NodeType { instanceRange: string } - export interface Snapshot { /** * UUID of the snapshot. @@ -358,7 +335,6 @@ export interface Snapshot { region: ScwRegion } - export interface User { /** * Name of the user (Length must be between 1 and 63 characters. First character must be an alphabet character (a-zA-Z). Only a-zA-Z0-9_$- characters are accepted). @@ -370,7 +346,6 @@ export interface User { roles: UserRole[] } - export interface Version { /** * MongoDB® major engine version. @@ -382,7 +357,6 @@ export interface Version { endOfLifeAt?: Date } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -398,7 +372,6 @@ export type CreateEndpointRequest = { endpoint: EndpointSpec } - export type CreateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -446,7 +419,6 @@ export type CreateInstanceRequest = { endpoints?: EndpointSpec[] } - export type CreateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -466,7 +438,6 @@ export type CreateSnapshotRequest = { expiresAt?: Date } - export type CreateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -486,7 +457,6 @@ export type CreateUserRequest = { password: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -498,7 +468,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type DeleteInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -510,7 +479,6 @@ export type DeleteInstanceRequest = { instanceId: string } - export type DeleteSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -522,7 +490,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -538,7 +505,6 @@ export type DeleteUserRequest = { name: string } - export type GetInstanceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -550,7 +516,6 @@ export type GetInstanceCertificateRequest = { instanceId: string } - export type GetInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -562,7 +527,6 @@ export type GetInstanceRequest = { instanceId: string } - export type GetSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -574,7 +538,6 @@ export type GetSnapshotRequest = { snapshotId: string } - export type ListDatabasesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -592,7 +555,6 @@ export type ListDatabasesRequest = { pageSize?: number } - export interface ListDatabasesResponse { /** * List of the databases. @@ -604,7 +566,6 @@ export interface ListDatabasesResponse { totalCount: number } - export type ListInstancesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -634,7 +595,6 @@ export type ListInstancesRequest = { pageSize?: number } - export interface ListInstancesResponse { /** * List of all Database Instances available in an Organization or Project. @@ -646,7 +606,6 @@ export interface ListInstancesResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -660,7 +619,6 @@ export type ListNodeTypesRequest = { pageSize?: number } - export interface ListNodeTypesResponse { /** * Types of the node. @@ -672,7 +630,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type ListSnapshotsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -702,7 +659,6 @@ export type ListSnapshotsRequest = { pageSize?: number } - export interface ListSnapshotsResponse { /** * List of all database snapshots available in an Organization or Project. @@ -714,7 +670,6 @@ export interface ListSnapshotsResponse { totalCount: number } - export type ListUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -736,7 +691,6 @@ export type ListUsersRequest = { pageSize?: number } - export interface ListUsersResponse { /** * List of users in a Database Instance. @@ -748,7 +702,6 @@ export interface ListUsersResponse { totalCount: number } - export type ListVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -759,7 +712,6 @@ export type ListVersionsRequest = { pageSize?: number } - export interface ListVersionsResponse { /** * Available MongoDB® major engine version. @@ -771,7 +723,6 @@ export interface ListVersionsResponse { totalCount: number } - export type RestoreSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -799,7 +750,6 @@ export type RestoreSnapshotRequest = { volumeType: VolumeType } - export type SetUserRoleRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -819,7 +769,6 @@ export type SetUserRoleRequest = { roles?: UserRole[] } - export type UpdateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -851,7 +800,6 @@ export type UpdateInstanceRequest = { isSnapshotScheduleEnabled?: boolean } - export type UpdateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -871,7 +819,6 @@ export type UpdateSnapshotRequest = { expiresAt?: Date } - export type UpdateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -891,7 +838,6 @@ export type UpdateUserRequest = { password?: string } - export type UpgradeInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -908,5 +854,3 @@ export type UpgradeInstanceRequest = { */ volumeSizeBytes?: number } - - diff --git a/packages_generated/mongodb/src/v1alpha1/api.gen.ts b/packages_generated/mongodb/src/v1alpha1/api.gen.ts index ec962df25..7a80e271d 100644 --- a/packages_generated/mongodb/src/v1alpha1/api.gen.ts +++ b/packages_generated/mongodb/src/v1alpha1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_MONGODB,SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_MONGODB,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_MONGODB, + SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_MONGODB, +} from './content.gen.js' import { marshalCreateEndpointRequest, marshalCreateInstanceRequest, @@ -79,14 +82,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - - protected pageOfListNodeTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + + protected pageOfListNodeTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -94,12 +96,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['include_disabled_types', request.includeDisabledTypes], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. * @@ -109,21 +114,25 @@ export class API extends ParentAPI { listNodeTypes = (request: Readonly = {}) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - protected pageOfListVersions = (request: Readonly = {}) => + protected pageOfListVersions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListVersionsResponse, ) - + /** * List available MongoDB® versions. * @@ -133,8 +142,9 @@ export class API extends ParentAPI { listVersions = (request: Readonly = {}) => enrichForPagination('versions', this.pageOfListVersions, request) - - protected pageOfListInstances = (request: Readonly = {}) => + protected pageOfListInstances = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -144,14 +154,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListInstancesResponse, ) - + /** * List MongoDB® Database Instances. List all MongoDB® Database Instances in the specified region. By default, the MongoDB® Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -161,7 +174,6 @@ export class API extends ParentAPI { listInstances = (request: Readonly = {}) => enrichForPagination('instances', this.pageOfListInstances, request) - /** * Get a MongoDB® Database Instance. Retrieve information about a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object. * @@ -176,7 +188,7 @@ export class API extends ParentAPI { }, unmarshalInstance, ) - + /** * Waits for {@link Instance} to be in a final state. * @@ -189,13 +201,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES_MONGODB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !INSTANCE_TRANSIENT_STATUSES_MONGODB.includes(res.status), + )), this.getInstance, request, options, ) - /** * Create a MongoDB® Database Instance. Create a new MongoDB® Database Instance. * @@ -215,7 +230,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Update a MongoDB® Database Instance. Update the parameters of a MongoDB® Database Instance. * @@ -235,7 +249,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Delete a MongoDB® Database Instance. Delete a given MongoDB® Database Instance, specified by the `region` and `instance_id` parameters. Deleting a MongoDB® Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. * @@ -251,7 +264,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Upgrade a Database Instance. Upgrade your current Database Instance specifications like volume size. * @@ -271,7 +283,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Get the certificate of a Database Instance. Retrieve the certificate of a given Database Instance, specified by the `instance_id` parameter. * @@ -279,18 +290,13 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ getInstanceCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the `name` and `instance_id` parameters in the request. * @@ -310,7 +316,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - /** * Get a Database Instance snapshot. Retrieve information about a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to retrieve. * @@ -325,7 +330,7 @@ export class API extends ParentAPI { }, unmarshalSnapshot, ) - + /** * Waits for {@link Snapshot} to be in a final state. * @@ -338,13 +343,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES_MONGODB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SNAPSHOT_TRANSIENT_STATUSES_MONGODB.includes(res.status), + )), this.getSnapshot, request, options, ) - /** * Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters. * @@ -364,7 +372,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - /** * Restore a Database Instance snapshot. Restore a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to restore, the `instance_name` of the new Database Instance, `node_type` of the new Database Instance and `node_number` of the new Database Instance. * @@ -384,8 +391,9 @@ export class API extends ParentAPI { unmarshalInstance, ) - - protected pageOfListSnapshots = (request: Readonly = {}) => + protected pageOfListSnapshots = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -396,13 +404,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSnapshotsResponse, ) - + /** * List snapshots. List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -412,7 +423,6 @@ export class API extends ParentAPI { listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `snapshot_id` parameter of the snapshot you want to delete. * @@ -428,7 +438,6 @@ export class API extends ParentAPI { unmarshalSnapshot, ) - protected pageOfListUsers = (request: Readonly) => this.client.fetch( { @@ -438,12 +447,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListUsersResponse, ) - + /** * List users of a Database Instance. List all users of a given Database Instance. * @@ -453,7 +465,6 @@ export class API extends ParentAPI { listUsers = (request: Readonly) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Create an user on a Database Instance. Create an user on a Database Instance. You must define the `name`, `password` of the user and `instance_id` parameters in the request. * @@ -473,7 +484,6 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the `password` parameter, but you cannot change the name of the user. * @@ -493,23 +503,19 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Delete a user on a Database Instance. Delete an existing user on a Database Instance. * * @param request - The request {@link DeleteUserRequest} */ deleteUser = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'DELETE', - path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'DELETE', + path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, + }) - /** * Apply user roles. Apply preset roles for a user in a Database Instance. * @@ -529,21 +535,17 @@ export class API extends ParentAPI { unmarshalUser, ) - /** * Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/mongodb/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - /** * Create a new Instance endpoint. Create a new endpoint for a MongoDB® Database Instance. You can add `public_network` or `private_network` specifications to the body of the request. * @@ -562,7 +564,4 @@ export class API extends ParentAPI { }, unmarshalEndpoint, ) - - } - diff --git a/packages_generated/mongodb/src/v1alpha1/content.gen.ts b/packages_generated/mongodb/src/v1alpha1/content.gen.ts index 3d153296b..aba79fb49 100644 --- a/packages_generated/mongodb/src/v1alpha1/content.gen.ts +++ b/packages_generated/mongodb/src/v1alpha1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - InstanceStatus, - SnapshotStatus, -} from './types.gen.js' - +import type { InstanceStatus, SnapshotStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link InstanceStatus}. */ export const INSTANCE_TRANSIENT_STATUSES: InstanceStatus[] = [ @@ -21,4 +17,3 @@ export const SNAPSHOT_TRANSIENT_STATUSES: SnapshotStatus[] = [ 'restoring', 'deleting', ] - diff --git a/packages_generated/mongodb/src/v1alpha1/index.gen.ts b/packages_generated/mongodb/src/v1alpha1/index.gen.ts index bba91cd66..be7df4512 100644 --- a/packages_generated/mongodb/src/v1alpha1/index.gen.ts +++ b/packages_generated/mongodb/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/mongodb/src/v1alpha1/marshalling.gen.ts b/packages_generated/mongodb/src/v1alpha1/marshalling.gen.ts index d7125269b..4cf0242a1 100644 --- a/packages_generated/mongodb/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/mongodb/src/v1alpha1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointPrivateNetworkDetails, @@ -41,7 +46,9 @@ import type { UpgradeInstanceRequest, } from './types.gen.js' -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -53,15 +60,16 @@ const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateN } as EndpointPrivateNetworkDetails } -const unmarshalEndpointPublicDetails = (data: unknown): EndpointPublicDetails => { +const unmarshalEndpointPublicDetails = ( + data: unknown, +): EndpointPublicDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPublicDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointPublicDetails + return {} as EndpointPublicDetails } export const unmarshalEndpoint = (data: unknown): Endpoint => { @@ -76,8 +84,12 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { id: data.id, ips: data.ips, port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, - public: data.public ? unmarshalEndpointPublicDetails(data.public) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, + public: data.public + ? unmarshalEndpointPublicDetails(data.public) + : undefined, } as Endpoint } @@ -94,7 +106,9 @@ export const unmarshalInstanceSetting = (data: unknown): InstanceSetting => { } as InstanceSetting } -const unmarshalInstanceSnapshotSchedule = (data: unknown): InstanceSnapshotSchedule => { +const unmarshalInstanceSnapshotSchedule = ( + data: unknown, +): InstanceSnapshotSchedule => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`, @@ -140,7 +154,9 @@ export const unmarshalInstance = (data: unknown): Instance => { projectId: data.project_id, region: data.region, settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting), - snapshotSchedule: data.snapshot_schedule ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) : undefined, + snapshotSchedule: data.snapshot_schedule + ? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule) + : undefined, status: data.status, tags: data.tags, version: data.version, @@ -179,7 +195,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => { size: data.size, status: data.status, updatedAt: unmarshalDate(data.updated_at), - volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : undefined, + volumeType: data.volume_type + ? unmarshalSnapshotVolumeType(data.volume_type) + : undefined, } as Snapshot } @@ -210,7 +228,9 @@ export const unmarshalUser = (data: unknown): User => { } as User } -export const unmarshalListInstancesResponse = (data: unknown): ListInstancesResponse => { +export const unmarshalListInstancesResponse = ( + data: unknown, +): ListInstancesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`, @@ -247,7 +267,10 @@ const unmarshalNodeType = (data: unknown): NodeType => { } return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType), + availableVolumeTypes: unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType, + ), beta: data.beta, description: data.description, disabled: data.disabled, @@ -259,7 +282,9 @@ const unmarshalNodeType = (data: unknown): NodeType => { } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -272,7 +297,9 @@ export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResp } as ListNodeTypesResponse } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -285,7 +312,9 @@ export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResp } as ListSnapshotsResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -328,13 +357,18 @@ const unmarshalVersion = (data: unknown): Version => { } return { - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalSetting), + availableSettings: unmarshalArrayOfObject( + data.available_settings, + unmarshalSetting, + ), endOfLifeAt: unmarshalDate(data.end_of_life_at), version: data.version, } as Version } -export const unmarshalListVersionsResponse = (data: unknown): ListVersionsResponse => { +export const unmarshalListVersionsResponse = ( + data: unknown, +): ListVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVersionsResponse' failed as data isn't a dictionary.`, @@ -357,21 +391,29 @@ const marshalEndpointSpecPrivateNetworkDetails = ( const marshalEndpointSpecPublicDetails = ( request: EndpointSpecPublicDetails, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'public', - value: (request.public !== undefined) ? marshalEndpointSpecPublicDetails(request.public, defaults) - : undefined, + { + param: 'public', + value: + request.public !== undefined + ? marshalEndpointSpecPublicDetails(request.public, defaults) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkDetails(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkDetails( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -380,7 +422,7 @@ export const marshalCreateEndpointRequest = ( request: CreateEndpointRequest, defaults: DefaultValues, ): Record => ({ - endpoint: marshalEndpointSpec(request.endpoint, defaults), + endpoint: marshalEndpointSpec(request.endpoint, defaults), instance_id: request.instanceId, }) @@ -396,7 +438,10 @@ export const marshalCreateInstanceRequest = ( request: CreateInstanceRequest, defaults: DefaultValues, ): Record => ({ - endpoints: ((request.endpoints !== undefined) ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), + endpoints: + request.endpoints !== undefined + ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, name: request.name || randomName('mgdb'), node_number: request.nodeNumber, node_type: request.nodeType, @@ -405,7 +450,10 @@ export const marshalCreateInstanceRequest = ( tags: request.tags, user_name: request.userName, version: request.version, - volume: ((request.volume !== undefined) ? marshalCreateInstanceRequestVolumeDetails(request.volume, defaults): undefined), + volume: + request.volume !== undefined + ? marshalCreateInstanceRequestVolumeDetails(request.volume, defaults) + : undefined, }) export const marshalCreateSnapshotRequest = ( @@ -438,21 +486,17 @@ export const marshalRestoreSnapshotRequest = ( instance_name: request.instanceName, node_number: request.nodeNumber, node_type: request.nodeType, - volume: marshalRestoreSnapshotRequestVolumeDetails(request.volume, defaults), + volume: marshalRestoreSnapshotRequestVolumeDetails(request.volume, defaults), }) const marshalUserRole = ( request: UserRole, defaults: DefaultValues, ): Record => ({ - role: request.role, + role: request.role, ...resolveOneOf([ - {param: 'database', - value: request.database, - }, - {param: 'any_database', - value: request.anyDatabase, - }, + { param: 'database', value: request.database }, + { param: 'any_database', value: request.anyDatabase }, ]), }) @@ -460,7 +504,10 @@ export const marshalSetUserRoleRequest = ( request: SetUserRoleRequest, defaults: DefaultValues, ): Record => ({ - roles: ((request.roles !== undefined) ? request.roles.map(elt => marshalUserRole(elt, defaults)): undefined), + roles: + request.roles !== undefined + ? request.roles.map(elt => marshalUserRole(elt, defaults)) + : undefined, user_name: request.userName, }) @@ -490,10 +537,6 @@ export const marshalUpdateUserRequest = ( export const marshalUpgradeInstanceRequest = ( request: UpgradeInstanceRequest, defaults: DefaultValues, -): Record => ({ - ...resolveOneOf([ - {param: 'volume_size', - value: request.volumeSize, - }, - ]), +): Record => ({ + ...resolveOneOf([{ param: 'volume_size', value: request.volumeSize }]), }) diff --git a/packages_generated/mongodb/src/v1alpha1/types.gen.ts b/packages_generated/mongodb/src/v1alpha1/types.gen.ts index d8aa2cc2b..1f71a0b2c 100644 --- a/packages_generated/mongodb/src/v1alpha1/types.gen.ts +++ b/packages_generated/mongodb/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type InstanceStatus = | 'unknown_status' @@ -30,9 +29,7 @@ export type ListSnapshotsRequestOrderBy = | 'expires_at_asc' | 'expires_at_desc' -export type ListUsersRequestOrderBy = - | 'name_asc' - | 'name_desc' +export type ListUsersRequestOrderBy = 'name_asc' | 'name_desc' export type NodeTypeStock = | 'unknown_stock' @@ -40,11 +37,7 @@ export type NodeTypeStock = | 'out_of_stock' | 'available' -export type SettingPropertyType = - | 'BOOLEAN' - | 'INT' - | 'STRING' - | 'FLOAT' +export type SettingPropertyType = 'BOOLEAN' | 'INT' | 'STRING' | 'FLOAT' export type SnapshotStatus = | 'unknown_status' @@ -62,10 +55,7 @@ export type UserRoleRole = | 'db_admin' | 'sync' -export type VolumeType = - | 'unknown_type' - | 'sbs_5k' - | 'sbs_15k' +export type VolumeType = 'unknown_type' | 'sbs_5k' | 'sbs_15k' /** * Private Network details. @@ -77,10 +67,7 @@ export interface EndpointPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointPublicDetails { -} - +export interface EndpointPublicDetails {} export interface EndpointSpecPrivateNetworkDetails { /** @@ -89,10 +76,7 @@ export interface EndpointSpecPrivateNetworkDetails { privateNetworkId: string } - -export interface EndpointSpecPublicDetails { -} - +export interface EndpointSpecPublicDetails {} export interface Endpoint { /** @@ -125,7 +109,6 @@ export interface Endpoint { public?: EndpointPublicDetails } - export interface InstanceSetting { /** * Name of the settings. @@ -137,7 +120,6 @@ export interface InstanceSetting { value: string } - export interface InstanceSnapshotSchedule { frequencyHours: number retentionDays: number @@ -146,7 +128,6 @@ export interface InstanceSnapshotSchedule { lastRun?: Date } - export interface Volume { /** * Type of volume where data is stored. @@ -158,7 +139,6 @@ export interface Volume { size: number } - export interface NodeTypeVolumeType { /** * Volume Type. @@ -182,12 +162,10 @@ export interface NodeTypeVolumeType { chunkSize: number } - export interface SnapshotVolumeType { type: VolumeType } - export interface UserRole { /** * Name of the preset role. @@ -207,7 +185,6 @@ export interface UserRole { anyDatabase?: boolean } - export interface Setting { /** * Setting name from the database engine. @@ -255,7 +232,6 @@ export interface Setting { floatMax?: number } - export interface EndpointSpec { /** * @@ -269,7 +245,6 @@ export interface EndpointSpec { privateNetwork?: EndpointSpecPrivateNetworkDetails } - export interface CreateInstanceRequestVolumeDetails { /** * Volume size. @@ -281,7 +256,6 @@ export interface CreateInstanceRequestVolumeDetails { volumeType: VolumeType } - export interface Instance { /** * UUID of the Database Instance. @@ -341,7 +315,6 @@ export interface Instance { region: ScwRegion } - export interface NodeType { /** * Node type name identifier. @@ -381,7 +354,6 @@ export interface NodeType { instanceRange: string } - export interface Snapshot { /** * UUID of the snapshot. @@ -433,7 +405,6 @@ export interface Snapshot { region: ScwRegion } - export interface User { /** * Name of the user (Length must be between 1 and 63 characters. First character must be an alphabet character (a-zA-Z). Only a-zA-Z0-9_$- characters are accepted). @@ -445,7 +416,6 @@ export interface User { roles: UserRole[] } - export interface Version { /** * MongoDB® engine version. @@ -461,7 +431,6 @@ export interface Version { availableSettings: Setting[] } - export interface RestoreSnapshotRequestVolumeDetails { /** * Type of volume where data is stored. @@ -469,7 +438,6 @@ export interface RestoreSnapshotRequestVolumeDetails { volumeType: VolumeType } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -485,7 +453,6 @@ export type CreateEndpointRequest = { endpoint: EndpointSpec } - export type CreateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -533,7 +500,6 @@ export type CreateInstanceRequest = { endpoints?: EndpointSpec[] } - export type CreateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -553,7 +519,6 @@ export type CreateSnapshotRequest = { expiresAt?: Date } - export type CreateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -573,7 +538,6 @@ export type CreateUserRequest = { password: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -585,7 +549,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type DeleteInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -597,7 +560,6 @@ export type DeleteInstanceRequest = { instanceId: string } - export type DeleteSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -609,7 +571,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -625,7 +586,6 @@ export type DeleteUserRequest = { name: string } - export type GetInstanceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -637,7 +597,6 @@ export type GetInstanceCertificateRequest = { instanceId: string } - export type GetInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -649,7 +608,6 @@ export type GetInstanceRequest = { instanceId: string } - export type GetSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -661,7 +619,6 @@ export type GetSnapshotRequest = { snapshotId: string } - export type ListInstancesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -691,7 +648,6 @@ export type ListInstancesRequest = { pageSize?: number } - export interface ListInstancesResponse { /** * List of all Database Instances available in an Organization or Project. @@ -703,7 +659,6 @@ export interface ListInstancesResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -717,7 +672,6 @@ export type ListNodeTypesRequest = { pageSize?: number } - export interface ListNodeTypesResponse { /** * Types of the node. @@ -729,7 +683,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type ListSnapshotsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -759,7 +712,6 @@ export type ListSnapshotsRequest = { pageSize?: number } - export interface ListSnapshotsResponse { /** * List of all database snapshots available in an Organization or Project. @@ -771,7 +723,6 @@ export interface ListSnapshotsResponse { totalCount: number } - export type ListUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -793,7 +744,6 @@ export type ListUsersRequest = { pageSize?: number } - export interface ListUsersResponse { /** * List of users in a Database Instance. @@ -805,7 +755,6 @@ export interface ListUsersResponse { totalCount: number } - export type ListVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -816,7 +765,6 @@ export type ListVersionsRequest = { pageSize?: number } - export interface ListVersionsResponse { /** * Available MongoDB® engine version. @@ -828,7 +776,6 @@ export interface ListVersionsResponse { totalCount: number } - export type RestoreSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -856,7 +803,6 @@ export type RestoreSnapshotRequest = { volume: RestoreSnapshotRequestVolumeDetails } - export type SetUserRoleRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -876,7 +822,6 @@ export type SetUserRoleRequest = { roles?: UserRole[] } - export type UpdateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -896,7 +841,6 @@ export type UpdateInstanceRequest = { tags?: string[] } - export type UpdateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -916,7 +860,6 @@ export type UpdateSnapshotRequest = { expiresAt?: Date } - export type UpdateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -936,7 +879,6 @@ export type UpdateUserRequest = { password?: string } - export type UpgradeInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -953,5 +895,3 @@ export type UpgradeInstanceRequest = { */ volumeSize?: number } - - diff --git a/packages_generated/product_catalog/src/v2alpha1/api.gen.ts b/packages_generated/product_catalog/src/v2alpha1/api.gen.ts index a0852aea8..b916a546d 100644 --- a/packages_generated/product_catalog/src/v2alpha1/api.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/api.gen.ts @@ -6,10 +6,8 @@ import { resolveOneOf, urlParams, } from '@scaleway/sdk-client' -import type { Zone as ScwZone, Region as ScwRegion, } from '@scaleway/sdk-client' -import { - unmarshalListPublicCatalogProductsResponse, -} from './marshalling.gen.js' +import type { Zone as ScwZone, Region as ScwRegion } from '@scaleway/sdk-client' +import { unmarshalListPublicCatalogProductsResponse } from './marshalling.gen.js' import type { ListPublicCatalogProductsResponse, PublicCatalogApiListPublicCatalogProductsRequest, @@ -19,44 +17,54 @@ import type { * Product Catalog API. */ export class PublicCatalogAPI extends ParentAPI { - protected pageOfListPublicCatalogProducts = (request: Readonly = {}) => + protected pageOfListPublicCatalogProducts = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/product-catalog/v2alpha1/public-catalog/products`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['product_types', request.productTypes], - ['status', request.status], - ...Object.entries(resolveOneOf([ - {param: 'global', - value: request.global, - }, - {default: this.client.settings.defaultRegion,param: 'region', - value: request.region, - }, - {default: this.client.settings.defaultZone,param: 'zone', - value: request.zone, - }, - {param: 'datacenter', - value: request.datacenter, - }, - ])), + ['status', request.status], + ...Object.entries( + resolveOneOf([ + { param: 'global', value: request.global }, + { + default: this.client.settings.defaultRegion, + param: 'region', + value: request.region, + }, + { + default: this.client.settings.defaultZone, + param: 'zone', + value: request.zone, + }, + { param: 'datacenter', value: request.datacenter }, + ]), + ), ), }, unmarshalListPublicCatalogProductsResponse, ) - + /** * List all available products. List all available products in the Scaleway catalog. Returns a complete list of products with their corresponding description, locations, prices and properties. You can define the `page` number and `page_size` for your query in the request. * * @param request - The request {@link PublicCatalogApiListPublicCatalogProductsRequest} * @returns A Promise of ListPublicCatalogProductsResponse */ - listPublicCatalogProducts = (request: Readonly = {}) => - enrichForPagination('products', this.pageOfListPublicCatalogProducts, request) - - + listPublicCatalogProducts = ( + request: Readonly = {}, + ) => + enrichForPagination( + 'products', + this.pageOfListPublicCatalogProducts, + request, + ) } - diff --git a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts index 1ef2f71a3..8519a3fc4 100644 --- a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - PublicCatalogAPI, -} from './api.gen.js' +export { PublicCatalogAPI } from './api.gen.js' export * from './marshalling.gen.js' export type { ListPublicCatalogProductsRequestProductType, diff --git a/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts b/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts index bbdf3b5e5..02d89553e 100644 --- a/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { PublicCatalogProductPropertiesHardwareCPUPhysical, PublicCatalogProductPropertiesHardwareCPUVirtual, @@ -8,10 +12,6 @@ import type { PublicCatalogProductPropertiesHardwareNetwork, PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, - PublicCatalogProductPropertiesObjectStorageClassType, - PublicCatalogProductPropertiesObjectStorageInternetTrafficType, - PublicCatalogProductPropertiesObjectStorageRegionTrafficType, - PublicCatalogProductPropertiesObjectStorageRestoreType, PublicCatalogProductPropertiesAppleSilicon, PublicCatalogProductPropertiesBlockStorage, PublicCatalogProductPropertiesDedibox, @@ -19,12 +19,9 @@ import type { PublicCatalogProductPropertiesGenerativeApis, PublicCatalogProductPropertiesHardware, PublicCatalogProductPropertiesInstance, - PublicCatalogProductPropertiesKeyManager, PublicCatalogProductPropertiesLoadBalancer, PublicCatalogProductPropertiesManagedInference, - PublicCatalogProductPropertiesManagedRedisDatabase, PublicCatalogProductPropertiesObjectStorage, - PublicCatalogProductPropertiesSecretManager, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, @@ -34,7 +31,9 @@ import type { ListPublicCatalogProductsResponse, } from './types.gen.js' -const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data: unknown): PublicCatalogProductPropertiesHardwareCPUPhysical => { +const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPUPhysical => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUPhysical' failed as data isn't a dictionary.`, @@ -50,7 +49,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical = (data: unknow } as PublicCatalogProductPropertiesHardwareCPUPhysical } -const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data: unknown): PublicCatalogProductPropertiesHardwareCPUVirtual => { +const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPUVirtual => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPUVirtual' failed as data isn't a dictionary.`, @@ -62,7 +63,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual = (data: unknown } as PublicCatalogProductPropertiesHardwareCPUVirtual } -const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data: unknown): PublicCatalogProductPropertiesHardwareCPU => { +const unmarshalPublicCatalogProductPropertiesHardwareCPU = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareCPU => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareCPU' failed as data isn't a dictionary.`, @@ -72,14 +75,22 @@ const unmarshalPublicCatalogProductPropertiesHardwareCPU = (data: unknown): Publ return { arch: data.arch, description: data.description, - physical: data.physical ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical(data.physical) : undefined, + physical: data.physical + ? unmarshalPublicCatalogProductPropertiesHardwareCPUPhysical( + data.physical, + ) + : undefined, threads: data.threads, type: data.type, - virtual: data.virtual ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) : undefined, + virtual: data.virtual + ? unmarshalPublicCatalogProductPropertiesHardwareCPUVirtual(data.virtual) + : undefined, } as PublicCatalogProductPropertiesHardwareCPU } -const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data: unknown): PublicCatalogProductPropertiesHardwareGPU => { +const unmarshalPublicCatalogProductPropertiesHardwareGPU = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareGPU => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareGPU' failed as data isn't a dictionary.`, @@ -93,7 +104,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareGPU = (data: unknown): Publ } as PublicCatalogProductPropertiesHardwareGPU } -const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data: unknown): PublicCatalogProductPropertiesHardwareNetwork => { +const unmarshalPublicCatalogProductPropertiesHardwareNetwork = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareNetwork => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareNetwork' failed as data isn't a dictionary.`, @@ -108,7 +121,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareNetwork = (data: unknown): } as PublicCatalogProductPropertiesHardwareNetwork } -const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data: unknown): PublicCatalogProductPropertiesHardwareRAM => { +const unmarshalPublicCatalogProductPropertiesHardwareRAM = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareRAM => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareRAM' failed as data isn't a dictionary.`, @@ -122,7 +137,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareRAM = (data: unknown): Publ } as PublicCatalogProductPropertiesHardwareRAM } -const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data: unknown): PublicCatalogProductPropertiesHardwareStorage => { +const unmarshalPublicCatalogProductPropertiesHardwareStorage = ( + data: unknown, +): PublicCatalogProductPropertiesHardwareStorage => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardwareStorage' failed as data isn't a dictionary.`, @@ -135,55 +152,9 @@ const unmarshalPublicCatalogProductPropertiesHardwareStorage = (data: unknown): } as PublicCatalogProductPropertiesHardwareStorage } -const unmarshalPublicCatalogProductPropertiesObjectStorageClassType = (data: unknown): PublicCatalogProductPropertiesObjectStorageClassType => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageClassType' failed as data isn't a dictionary.`, - ) - } - - return { - storageClass: data.storage_class, - } as PublicCatalogProductPropertiesObjectStorageClassType -} - -const unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType = (data: unknown): PublicCatalogProductPropertiesObjectStorageInternetTrafficType => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageInternetTrafficType' failed as data isn't a dictionary.`, - ) - } - - return { - trafficType: data.traffic_type, - } as PublicCatalogProductPropertiesObjectStorageInternetTrafficType -} - -const unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType = (data: unknown): PublicCatalogProductPropertiesObjectStorageRegionTrafficType => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRegionTrafficType' failed as data isn't a dictionary.`, - ) - } - - return { - regionDestination: data.region_destination, - } as PublicCatalogProductPropertiesObjectStorageRegionTrafficType -} - -const unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType = (data: unknown): PublicCatalogProductPropertiesObjectStorageRestoreType => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorageRestoreType' failed as data isn't a dictionary.`, - ) - } - - return { - restoreType: data.restore_type, - } as PublicCatalogProductPropertiesObjectStorageRestoreType -} - -const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data: unknown): PublicCatalogProductPropertiesAppleSilicon => { +const unmarshalPublicCatalogProductPropertiesAppleSilicon = ( + data: unknown, +): PublicCatalogProductPropertiesAppleSilicon => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesAppleSilicon' failed as data isn't a dictionary.`, @@ -196,7 +167,9 @@ const unmarshalPublicCatalogProductPropertiesAppleSilicon = (data: unknown): Pub } as PublicCatalogProductPropertiesAppleSilicon } -const unmarshalPublicCatalogProductPropertiesBlockStorage = (data: unknown): PublicCatalogProductPropertiesBlockStorage => { +const unmarshalPublicCatalogProductPropertiesBlockStorage = ( + data: unknown, +): PublicCatalogProductPropertiesBlockStorage => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesBlockStorage' failed as data isn't a dictionary.`, @@ -209,7 +182,9 @@ const unmarshalPublicCatalogProductPropertiesBlockStorage = (data: unknown): Pub } as PublicCatalogProductPropertiesBlockStorage } -const unmarshalPublicCatalogProductPropertiesDedibox = (data: unknown): PublicCatalogProductPropertiesDedibox => { +const unmarshalPublicCatalogProductPropertiesDedibox = ( + data: unknown, +): PublicCatalogProductPropertiesDedibox => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesDedibox' failed as data isn't a dictionary.`, @@ -222,7 +197,9 @@ const unmarshalPublicCatalogProductPropertiesDedibox = (data: unknown): PublicCa } as PublicCatalogProductPropertiesDedibox } -const unmarshalPublicCatalogProductPropertiesElasticMetal = (data: unknown): PublicCatalogProductPropertiesElasticMetal => { +const unmarshalPublicCatalogProductPropertiesElasticMetal = ( + data: unknown, +): PublicCatalogProductPropertiesElasticMetal => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesElasticMetal' failed as data isn't a dictionary.`, @@ -235,7 +212,9 @@ const unmarshalPublicCatalogProductPropertiesElasticMetal = (data: unknown): Pub } as PublicCatalogProductPropertiesElasticMetal } -const unmarshalPublicCatalogProductPropertiesGenerativeApis = (data: unknown): PublicCatalogProductPropertiesGenerativeApis => { +const unmarshalPublicCatalogProductPropertiesGenerativeApis = ( + data: unknown, +): PublicCatalogProductPropertiesGenerativeApis => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesGenerativeApis' failed as data isn't a dictionary.`, @@ -249,7 +228,9 @@ const unmarshalPublicCatalogProductPropertiesGenerativeApis = (data: unknown): P } as PublicCatalogProductPropertiesGenerativeApis } -const unmarshalPublicCatalogProductPropertiesHardware = (data: unknown): PublicCatalogProductPropertiesHardware => { +const unmarshalPublicCatalogProductPropertiesHardware = ( + data: unknown, +): PublicCatalogProductPropertiesHardware => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesHardware' failed as data isn't a dictionary.`, @@ -257,15 +238,27 @@ const unmarshalPublicCatalogProductPropertiesHardware = (data: unknown): PublicC } return { - cpu: data.cpu ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) : undefined, - gpu: data.gpu ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) : undefined, - network: data.network ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) : undefined, - ram: data.ram ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) : undefined, - storage: data.storage ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) : undefined, + cpu: data.cpu + ? unmarshalPublicCatalogProductPropertiesHardwareCPU(data.cpu) + : undefined, + gpu: data.gpu + ? unmarshalPublicCatalogProductPropertiesHardwareGPU(data.gpu) + : undefined, + network: data.network + ? unmarshalPublicCatalogProductPropertiesHardwareNetwork(data.network) + : undefined, + ram: data.ram + ? unmarshalPublicCatalogProductPropertiesHardwareRAM(data.ram) + : undefined, + storage: data.storage + ? unmarshalPublicCatalogProductPropertiesHardwareStorage(data.storage) + : undefined, } as PublicCatalogProductPropertiesHardware } -const unmarshalPublicCatalogProductPropertiesInstance = (data: unknown): PublicCatalogProductPropertiesInstance => { +const unmarshalPublicCatalogProductPropertiesInstance = ( + data: unknown, +): PublicCatalogProductPropertiesInstance => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesInstance' failed as data isn't a dictionary.`, @@ -279,29 +272,21 @@ const unmarshalPublicCatalogProductPropertiesInstance = (data: unknown): PublicC } as PublicCatalogProductPropertiesInstance } -const unmarshalPublicCatalogProductPropertiesKeyManager = (data: unknown): PublicCatalogProductPropertiesKeyManager => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesKeyManager' failed as data isn't a dictionary.`, - ) - } - - return { - } as PublicCatalogProductPropertiesKeyManager -} - -const unmarshalPublicCatalogProductPropertiesLoadBalancer = (data: unknown): PublicCatalogProductPropertiesLoadBalancer => { +const unmarshalPublicCatalogProductPropertiesLoadBalancer = ( + data: unknown, +): PublicCatalogProductPropertiesLoadBalancer => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesLoadBalancer' failed as data isn't a dictionary.`, ) } - return { - } as PublicCatalogProductPropertiesLoadBalancer + return {} as PublicCatalogProductPropertiesLoadBalancer } -const unmarshalPublicCatalogProductPropertiesManagedInference = (data: unknown): PublicCatalogProductPropertiesManagedInference => { +const unmarshalPublicCatalogProductPropertiesManagedInference = ( + data: unknown, +): PublicCatalogProductPropertiesManagedInference => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary.`, @@ -313,44 +298,21 @@ const unmarshalPublicCatalogProductPropertiesManagedInference = (data: unknown): } as PublicCatalogProductPropertiesManagedInference } -const unmarshalPublicCatalogProductPropertiesManagedRedisDatabase = (data: unknown): PublicCatalogProductPropertiesManagedRedisDatabase => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesManagedRedisDatabase' failed as data isn't a dictionary.`, - ) - } - - return { - } as PublicCatalogProductPropertiesManagedRedisDatabase -} - -const unmarshalPublicCatalogProductPropertiesObjectStorage = (data: unknown): PublicCatalogProductPropertiesObjectStorage => { +const unmarshalPublicCatalogProductPropertiesObjectStorage = ( + data: unknown, +): PublicCatalogProductPropertiesObjectStorage => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPropertiesObjectStorage' failed as data isn't a dictionary.`, ) } - return { - class: data.class ? unmarshalPublicCatalogProductPropertiesObjectStorageClassType(data.class) : undefined, - internetTraffic: data.internet_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageInternetTrafficType(data.internet_traffic) : undefined, - regionTraffic: data.region_traffic ? unmarshalPublicCatalogProductPropertiesObjectStorageRegionTrafficType(data.region_traffic) : undefined, - restore: data.restore ? unmarshalPublicCatalogProductPropertiesObjectStorageRestoreType(data.restore) : undefined, - } as PublicCatalogProductPropertiesObjectStorage -} - -const unmarshalPublicCatalogProductPropertiesSecretManager = (data: unknown): PublicCatalogProductPropertiesSecretManager => { - if (!isJSONObject(data)) { - throw new TypeError( - `Unmarshalling the type 'PublicCatalogProductPropertiesSecretManager' failed as data isn't a dictionary.`, - ) - } - - return { - } as PublicCatalogProductPropertiesSecretManager + return {} as PublicCatalogProductPropertiesObjectStorage } -const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data: unknown): PublicCatalogProductEnvironmentalImpactEstimation => { +const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = ( + data: unknown, +): PublicCatalogProductEnvironmentalImpactEstimation => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductEnvironmentalImpactEstimation' failed as data isn't a dictionary.`, @@ -363,7 +325,9 @@ const unmarshalPublicCatalogProductEnvironmentalImpactEstimation = (data: unknow } as PublicCatalogProductEnvironmentalImpactEstimation } -const unmarshalPublicCatalogProductLocality = (data: unknown): PublicCatalogProductLocality => { +const unmarshalPublicCatalogProductLocality = ( + data: unknown, +): PublicCatalogProductLocality => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductLocality' failed as data isn't a dictionary.`, @@ -378,7 +342,9 @@ const unmarshalPublicCatalogProductLocality = (data: unknown): PublicCatalogProd } as PublicCatalogProductLocality } -const unmarshalPublicCatalogProductPrice = (data: unknown): PublicCatalogProductPrice => { +const unmarshalPublicCatalogProductPrice = ( + data: unknown, +): PublicCatalogProductPrice => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductPrice' failed as data isn't a dictionary.`, @@ -386,11 +352,15 @@ const unmarshalPublicCatalogProductPrice = (data: unknown): PublicCatalogProduct } return { - retailPrice: data.retail_price ? unmarshalMoney(data.retail_price) : undefined, + retailPrice: data.retail_price + ? unmarshalMoney(data.retail_price) + : undefined, } as PublicCatalogProductPrice } -const unmarshalPublicCatalogProductProperties = (data: unknown): PublicCatalogProductProperties => { +const unmarshalPublicCatalogProductProperties = ( + data: unknown, +): PublicCatalogProductProperties => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductProperties' failed as data isn't a dictionary.`, @@ -398,23 +368,48 @@ const unmarshalPublicCatalogProductProperties = (data: unknown): PublicCatalogPr } return { - appleSilicon: data.apple_silicon ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) : undefined, - blockStorage: data.block_storage ? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage) : undefined, - dedibox: data.dedibox ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) : undefined, - elasticMetal: data.elastic_metal ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) : undefined, - generativeApis: data.generative_apis ? unmarshalPublicCatalogProductPropertiesGenerativeApis(data.generative_apis) : undefined, - hardware: data.hardware ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) : undefined, - instance: data.instance ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) : undefined, - keyManager: data.key_manager ? unmarshalPublicCatalogProductPropertiesKeyManager(data.key_manager) : undefined, - loadBalancer: data.load_balancer ? unmarshalPublicCatalogProductPropertiesLoadBalancer(data.load_balancer) : undefined, - managedInference: data.managed_inference ? unmarshalPublicCatalogProductPropertiesManagedInference(data.managed_inference) : undefined, - managedRedisDatabase: data.managed_redis_database ? unmarshalPublicCatalogProductPropertiesManagedRedisDatabase(data.managed_redis_database) : undefined, - objectStorage: data.object_storage ? unmarshalPublicCatalogProductPropertiesObjectStorage(data.object_storage) : undefined, - secretManager: data.secret_manager ? unmarshalPublicCatalogProductPropertiesSecretManager(data.secret_manager) : undefined, + appleSilicon: data.apple_silicon + ? unmarshalPublicCatalogProductPropertiesAppleSilicon(data.apple_silicon) + : undefined, + blockStorage: data.block_storage + ? unmarshalPublicCatalogProductPropertiesBlockStorage(data.block_storage) + : undefined, + dedibox: data.dedibox + ? unmarshalPublicCatalogProductPropertiesDedibox(data.dedibox) + : undefined, + elasticMetal: data.elastic_metal + ? unmarshalPublicCatalogProductPropertiesElasticMetal(data.elastic_metal) + : undefined, + generativeApis: data.generative_apis + ? unmarshalPublicCatalogProductPropertiesGenerativeApis( + data.generative_apis, + ) + : undefined, + hardware: data.hardware + ? unmarshalPublicCatalogProductPropertiesHardware(data.hardware) + : undefined, + instance: data.instance + ? unmarshalPublicCatalogProductPropertiesInstance(data.instance) + : undefined, + loadBalancer: data.load_balancer + ? unmarshalPublicCatalogProductPropertiesLoadBalancer(data.load_balancer) + : undefined, + managedInference: data.managed_inference + ? unmarshalPublicCatalogProductPropertiesManagedInference( + data.managed_inference, + ) + : undefined, + objectStorage: data.object_storage + ? unmarshalPublicCatalogProductPropertiesObjectStorage( + data.object_storage, + ) + : undefined, } as PublicCatalogProductProperties } -const unmarshalPublicCatalogProductUnitOfMeasure = (data: unknown): PublicCatalogProductUnitOfMeasure => { +const unmarshalPublicCatalogProductUnitOfMeasure = ( + data: unknown, +): PublicCatalogProductUnitOfMeasure => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PublicCatalogProductUnitOfMeasure' failed as data isn't a dictionary.`, @@ -438,21 +433,35 @@ const unmarshalPublicCatalogProduct = (data: unknown): PublicCatalogProduct => { badges: data.badges, description: data.description, endOfLifeAt: unmarshalDate(data.end_of_life_at), - environmentalImpactEstimation: data.environmental_impact_estimation ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation(data.environmental_impact_estimation) : undefined, - locality: data.locality ? unmarshalPublicCatalogProductLocality(data.locality) : undefined, - price: data.price ? unmarshalPublicCatalogProductPrice(data.price) : undefined, + environmentalImpactEstimation: data.environmental_impact_estimation + ? unmarshalPublicCatalogProductEnvironmentalImpactEstimation( + data.environmental_impact_estimation, + ) + : undefined, + locality: data.locality + ? unmarshalPublicCatalogProductLocality(data.locality) + : undefined, + price: data.price + ? unmarshalPublicCatalogProductPrice(data.price) + : undefined, product: data.product, productCategory: data.product_category, - properties: data.properties ? unmarshalPublicCatalogProductProperties(data.properties) : undefined, + properties: data.properties + ? unmarshalPublicCatalogProductProperties(data.properties) + : undefined, serviceCategory: data.service_category, sku: data.sku, status: data.status, - unitOfMeasure: data.unit_of_measure ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) : undefined, + unitOfMeasure: data.unit_of_measure + ? unmarshalPublicCatalogProductUnitOfMeasure(data.unit_of_measure) + : undefined, variant: data.variant, } as PublicCatalogProduct } -export const unmarshalListPublicCatalogProductsResponse = (data: unknown): ListPublicCatalogProductsResponse => { +export const unmarshalListPublicCatalogProductsResponse = ( + data: unknown, +): ListPublicCatalogProductsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPublicCatalogProductsResponse' failed as data isn't a dictionary.`, @@ -460,7 +469,10 @@ export const unmarshalListPublicCatalogProductsResponse = (data: unknown): ListP } return { - products: unmarshalArrayOfObject(data.products, unmarshalPublicCatalogProduct), + products: unmarshalArrayOfObject( + data.products, + unmarshalPublicCatalogProduct, + ), totalCount: data.total_count, } as ListPublicCatalogProductsResponse } diff --git a/packages_generated/product_catalog/src/v2alpha1/types.gen.ts b/packages_generated/product_catalog/src/v2alpha1/types.gen.ts index b209ea1fb..989221c8d 100644 --- a/packages_generated/product_catalog/src/v2alpha1/types.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/types.gen.ts @@ -1,7 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { + Money, + Region as ScwRegion, + Zone as ScwZone, +} from '@scaleway/sdk-client' export type ListPublicCatalogProductsRequestProductType = | 'unknown_product_type' @@ -14,9 +17,6 @@ export type ListPublicCatalogProductsRequestProductType = | 'managed_inference' | 'generative_apis' | 'load_balancer' - | 'secret_manager' - | 'key_manager' - | 'managed_redis_database' export type ListPublicCatalogProductsRequestStatus = | 'unknown_status' @@ -50,22 +50,6 @@ export type PublicCatalogProductPropertiesHardwareCPUArch = | 'riscv' | 'apple_silicon' -export type PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass = - | 'unknown_storage_class' - | 'standard' - | 'glacier' - | 'onezone_ia' - -export type PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType = - | 'unknown_traffic_type' - | 'ingress' - | 'egress' - | 'alliance' - -export type PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType = - | 'unknown_restore_type' - | 'standard' - export type PublicCatalogProductStatus = | 'unknown_status' | 'public_beta' @@ -134,7 +118,6 @@ export interface PublicCatalogProductPropertiesHardwareCPUPhysical { benchmark: number } - export interface PublicCatalogProductPropertiesHardwareCPUVirtual { /** * The number of vCPUs. @@ -142,7 +125,6 @@ export interface PublicCatalogProductPropertiesHardwareCPUVirtual { count: number } - export interface PublicCatalogProductPropertiesHardwareCPU { /** * A human readable description of the CPU. @@ -174,7 +156,6 @@ export interface PublicCatalogProductPropertiesHardwareCPU { threads: number } - export interface PublicCatalogProductPropertiesHardwareGPU { /** * A human-readable description of the GPU. @@ -190,7 +171,6 @@ export interface PublicCatalogProductPropertiesHardwareGPU { type: string } - export interface PublicCatalogProductPropertiesHardwareNetwork { /** * A human-readable description of the network. @@ -210,7 +190,6 @@ export interface PublicCatalogProductPropertiesHardwareNetwork { maxPublicBandwidth: number } - export interface PublicCatalogProductPropertiesHardwareRAM { /** * A human-readable description of the RAM. @@ -226,7 +205,6 @@ export interface PublicCatalogProductPropertiesHardwareRAM { type: string } - export interface PublicCatalogProductPropertiesHardwareStorage { /** * A human-readable description of the storage. @@ -238,39 +216,6 @@ export interface PublicCatalogProductPropertiesHardwareStorage { total: number } - -export interface PublicCatalogProductPropertiesObjectStorageClassType { - /** - * The storage class. - */ - storageClass: PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass -} - - -export interface PublicCatalogProductPropertiesObjectStorageInternetTrafficType { - /** - * The type of internet traffic. - */ - trafficType: PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType -} - - -export interface PublicCatalogProductPropertiesObjectStorageRegionTrafficType { - /** - * The destination region for the region traffic. - */ - regionDestination: string -} - - -export interface PublicCatalogProductPropertiesObjectStorageRestoreType { - /** - * The type of restore. - */ - restoreType: PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType -} - - export interface PublicCatalogProductPropertiesAppleSilicon { /** * The range of the Apple Silicon server. @@ -282,7 +227,6 @@ export interface PublicCatalogProductPropertiesAppleSilicon { serverType: string } - export interface PublicCatalogProductPropertiesBlockStorage { /** * @deprecated The minimum size of storage volume for this product in bytes. Deprecated. @@ -294,7 +238,6 @@ export interface PublicCatalogProductPropertiesBlockStorage { maxVolumeSize?: number } - export interface PublicCatalogProductPropertiesDedibox { /** * The range of the Dedibox server. @@ -306,7 +249,6 @@ export interface PublicCatalogProductPropertiesDedibox { offerId: number } - export interface PublicCatalogProductPropertiesElasticMetal { /** * The range of the Elastic Metal server. @@ -318,14 +260,12 @@ export interface PublicCatalogProductPropertiesElasticMetal { offerId: string } - export interface PublicCatalogProductPropertiesGenerativeApis { reasoning: boolean supportedApis: string[] consumptionMode: PublicCatalogProductPropertiesGenerativeApisConsumptionMode } - export interface PublicCatalogProductPropertiesHardware { /** * The CPU hardware properties. @@ -349,7 +289,6 @@ export interface PublicCatalogProductPropertiesHardware { gpu?: PublicCatalogProductPropertiesHardwareGPU } - export interface PublicCatalogProductPropertiesInstance { /** * The range of the Instance server. @@ -365,14 +304,7 @@ export interface PublicCatalogProductPropertiesInstance { recommendedReplacementOfferIds: string[] } - -export interface PublicCatalogProductPropertiesKeyManager { -} - - -export interface PublicCatalogProductPropertiesLoadBalancer { -} - +export interface PublicCatalogProductPropertiesLoadBalancer {} export interface PublicCatalogProductPropertiesManagedInference { /** @@ -381,49 +313,13 @@ export interface PublicCatalogProductPropertiesManagedInference { instanceGpuName: string } - -export interface PublicCatalogProductPropertiesManagedRedisDatabase { -} - - -export interface PublicCatalogProductPropertiesObjectStorage { - /** - * The properties related to Object Storage class. - * - * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set. - */ - class?: PublicCatalogProductPropertiesObjectStorageClassType - /** - * The properties related to Object Storage restore operations. - * - * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set. - */ - restore?: PublicCatalogProductPropertiesObjectStorageRestoreType - /** - * The properties related to Object Storage internet traffic. - * - * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set. - */ - internetTraffic?: PublicCatalogProductPropertiesObjectStorageInternetTrafficType - /** - * The properties related to Object Storage region traffic. - * - * One-of ('type'): at most one of 'class', 'restore', 'internetTraffic', 'regionTraffic' could be set. - */ - regionTraffic?: PublicCatalogProductPropertiesObjectStorageRegionTrafficType -} - - -export interface PublicCatalogProductPropertiesSecretManager { -} - +export interface PublicCatalogProductPropertiesObjectStorage {} export interface PublicCatalogProductEnvironmentalImpactEstimation { kgCo2Equivalent?: number m3WaterUsage?: number } - export interface PublicCatalogProductLocality { /** * Whether or not the product is global. @@ -451,7 +347,6 @@ export interface PublicCatalogProductLocality { datacenter?: string } - export interface PublicCatalogProductPrice { /** * The retail price of the product. @@ -459,7 +354,6 @@ export interface PublicCatalogProductPrice { retailPrice?: Money } - export interface PublicCatalogProductProperties { /** * The hardware properties of the product (if supported). @@ -468,82 +362,64 @@ export interface PublicCatalogProductProperties { /** * The properties of Dedibox products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ dedibox?: PublicCatalogProductPropertiesDedibox /** * The properties of Elastic Metal products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ elasticMetal?: PublicCatalogProductPropertiesElasticMetal /** * The properties of Apple Silicon products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ appleSilicon?: PublicCatalogProductPropertiesAppleSilicon /** * The properties of Instance products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ instance?: PublicCatalogProductPropertiesInstance /** * The properties of Block Storage products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ blockStorage?: PublicCatalogProductPropertiesBlockStorage /** * The properties of Object Storage products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ objectStorage?: PublicCatalogProductPropertiesObjectStorage /** * The properties of Managed Inference products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ managedInference?: PublicCatalogProductPropertiesManagedInference /** * The properties of Generative APIs products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ generativeApis?: PublicCatalogProductPropertiesGenerativeApis /** * The properties of Load Balancer products. * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. + * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer' could be set. */ loadBalancer?: PublicCatalogProductPropertiesLoadBalancer - /** - * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. - */ - secretManager?: PublicCatalogProductPropertiesSecretManager - /** - * The properties of Managed Redis Database products. - * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. - */ - managedRedisDatabase?: PublicCatalogProductPropertiesManagedRedisDatabase - /** - * - * One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference', 'generativeApis', 'loadBalancer', 'secretManager', 'managedRedisDatabase', 'keyManager' could be set. - */ - keyManager?: PublicCatalogProductPropertiesKeyManager } - export interface PublicCatalogProductUnitOfMeasure { unit: PublicCatalogProductUnitOfMeasureCountableUnit size: number } - export interface PublicCatalogProduct { /** * The unique identifier of the product. @@ -603,7 +479,6 @@ export interface PublicCatalogProduct { badges: PublicCatalogProductProductBadge[] } - export interface ListPublicCatalogProductsResponse { /** * The list of products. @@ -615,7 +490,6 @@ export interface ListPublicCatalogProductsResponse { totalCount: number } - export type PublicCatalogApiListPublicCatalogProductsRequest = { /** * Number of the page. Value must be greater or equal to 1. @@ -658,5 +532,3 @@ export type PublicCatalogApiListPublicCatalogProductsRequest = { */ status?: ListPublicCatalogProductsRequestStatus[] } - - diff --git a/packages_generated/qaas/src/v1alpha1/api.gen.ts b/packages_generated/qaas/src/v1alpha1/api.gen.ts index 758eae5fd..6e67eb293 100644 --- a/packages_generated/qaas/src/v1alpha1/api.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/api.gen.ts @@ -8,8 +8,13 @@ import { validatePathParam, waitForResource, } from '@scaleway/sdk-client' -import type { WaitForOptions, } from '@scaleway/sdk-client' -import {BOOKING_TRANSIENT_STATUSES as BOOKING_TRANSIENT_STATUSES_QAAS,JOB_TRANSIENT_STATUSES as JOB_TRANSIENT_STATUSES_QAAS,PROCESS_TRANSIENT_STATUSES as PROCESS_TRANSIENT_STATUSES_QAAS,SESSION_TRANSIENT_STATUSES as SESSION_TRANSIENT_STATUSES_QAAS,} from './content.gen.js' +import type { WaitForOptions } from '@scaleway/sdk-client' +import { + BOOKING_TRANSIENT_STATUSES as BOOKING_TRANSIENT_STATUSES_QAAS, + JOB_TRANSIENT_STATUSES as JOB_TRANSIENT_STATUSES_QAAS, + PROCESS_TRANSIENT_STATUSES as PROCESS_TRANSIENT_STATUSES_QAAS, + SESSION_TRANSIENT_STATUSES as SESSION_TRANSIENT_STATUSES_QAAS, +} from './content.gen.js' import { unmarshalApplication, unmarshalBooking, @@ -115,7 +120,7 @@ export class API extends ParentAPI { }, unmarshalJob, ) - + /** * Waits for {@link Job} to be in a final state. * @@ -128,13 +133,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!JOB_TRANSIENT_STATUSES_QAAS.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!JOB_TRANSIENT_STATUSES_QAAS.includes(res.status))), this.getJob, request, options, ) - protected pageOfListJobs = (request: Readonly = {}) => this.client.fetch( { @@ -143,21 +149,26 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['tags', request.tags], - ...Object.entries(resolveOneOf([ - {param: 'session_id', - value: request.sessionId, - }, - {default: this.client.settings.defaultProjectId,param: 'project_id', - value: request.projectId, - }, - ])), + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + ['tags', request.tags], + ...Object.entries( + resolveOneOf([ + { param: 'session_id', value: request.sessionId }, + { + default: this.client.settings.defaultProjectId, + param: 'project_id', + value: request.projectId, + }, + ]), + ), ), }, unmarshalListJobsResponse, ) - + /** * List all jobs within a project or session. Retrieve information about all jobs within a given session. * @@ -167,7 +178,6 @@ export class API extends ParentAPI { listJobs = (request: Readonly = {}) => enrichForPagination('jobs', this.pageOfListJobs, request) - protected pageOfListJobResults = (request: Readonly) => this.client.fetch( { @@ -176,12 +186,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListJobResultsResponse, ) - + /** * List all results of a job. Retrieve all intermediate and final results of a job. * @@ -191,7 +204,6 @@ export class API extends ParentAPI { listJobResults = (request: Readonly) => enrichForPagination('jobResults', this.pageOfListJobResults, request) - /** * Create a job. Create a job to be executed inside a QPU session. * @@ -211,7 +223,6 @@ export class API extends ParentAPI { unmarshalJob, ) - /** * Update job information. Update job information about the provided **job ID**. * @@ -231,7 +242,6 @@ export class API extends ParentAPI { unmarshalJob, ) - /** * Cancel a job. Cancel the job corresponding to the provided **job ID**. * @@ -249,21 +259,17 @@ export class API extends ParentAPI { unmarshalJob, ) - /** * Delete a job. Delete the job corresponding to the provided **job ID**. * * @param request - The request {@link DeleteJobRequest} */ deleteJob = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/qaas/v1alpha1/jobs/${validatePathParam('jobId', request.jobId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/qaas/v1alpha1/jobs/${validatePathParam('jobId', request.jobId)}`, + }) - /** * Get a job circuit. Retrieve the circuit of the provided **job ID**. * @@ -279,7 +285,6 @@ export class API extends ParentAPI { unmarshalJobCircuit, ) - /** * Get platform information. Retrieve information about the provided **platform ID**, such as provider name, technology, and type. * @@ -295,8 +300,9 @@ export class API extends ParentAPI { unmarshalPlatform, ) - - protected pageOfListPlatforms = (request: Readonly = {}) => + protected pageOfListPlatforms = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -306,7 +312,10 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['platform_technology', request.platformTechnology], ['platform_type', request.platformType], ['provider_name', request.providerName], @@ -314,7 +323,7 @@ export class API extends ParentAPI { }, unmarshalListPlatformsResponse, ) - + /** * List all available platforms. Retrieve information about all platforms. * @@ -324,7 +333,6 @@ export class API extends ParentAPI { listPlatforms = (request: Readonly = {}) => enrichForPagination('platforms', this.pageOfListPlatforms, request) - /** * Get session information. Retrieve information about the provided **session ID**, such as name and status. * @@ -339,7 +347,7 @@ export class API extends ParentAPI { }, unmarshalSession, ) - + /** * Waits for {@link Session} to be in a final state. * @@ -352,14 +360,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SESSION_TRANSIENT_STATUSES_QAAS.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SESSION_TRANSIENT_STATUSES_QAAS.includes(res.status), + )), this.getSession, request, options, ) - - protected pageOfListSessions = (request: Readonly = {}) => + protected pageOfListSessions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -367,15 +380,21 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['platform_id', request.platformId], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['tags', request.tags], ), }, unmarshalListSessionsResponse, ) - + /** * List all sessions. Retrieve information about all QPU sessions. * @@ -385,7 +404,6 @@ export class API extends ParentAPI { listSessions = (request: Readonly = {}) => enrichForPagination('sessions', this.pageOfListSessions, request) - /** * Create a session. Create a new QPU session for the specified platform. Once ready, jobs can be sent to this session. * @@ -405,7 +423,6 @@ export class API extends ParentAPI { unmarshalSession, ) - /** * Update session information. Update session information of the provided **session ID**. * @@ -425,7 +442,6 @@ export class API extends ParentAPI { unmarshalSession, ) - /** * Terminate an existing session. Terminate a session by its unique ID and cancel all its attached jobs and bookings. * @@ -443,22 +459,20 @@ export class API extends ParentAPI { unmarshalSession, ) - /** * Delete an existing session. Delete a session by its unique ID and delete all its attached jobs and bookings. * * @param request - The request {@link DeleteSessionRequest} */ deleteSession = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/qaas/v1alpha1/sessions/${validatePathParam('sessionId', request.sessionId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/qaas/v1alpha1/sessions/${validatePathParam('sessionId', request.sessionId)}`, + }) - - protected pageOfListSessionACLs = (request: Readonly) => + protected pageOfListSessionACLs = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -466,16 +480,18 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListSessionACLsResponse, ) - + listSessionACLs = (request: Readonly) => enrichForPagination('acls', this.pageOfListSessionACLs, request) - /** * Create a process. Create a new process for the specified application on a specified platform. * @@ -495,7 +511,6 @@ export class API extends ParentAPI { unmarshalProcess, ) - /** * Get process information. Retrieve information about the provided **process ID**, such as name, status and progress. * @@ -510,7 +525,7 @@ export class API extends ParentAPI { }, unmarshalProcess, ) - + /** * Waits for {@link Process} to be in a final state. * @@ -523,14 +538,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!PROCESS_TRANSIENT_STATUSES_QAAS.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !PROCESS_TRANSIENT_STATUSES_QAAS.includes(res.status), + )), this.getProcess, request, options, ) - - protected pageOfListProcesses = (request: Readonly = {}) => + protected pageOfListProcesses = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -539,14 +559,20 @@ export class API extends ParentAPI { ['application_id', request.applicationId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['tags', request.tags], ), }, unmarshalListProcessesResponse, ) - + /** * List all processes. Retrieve information about all processes. * @@ -556,7 +582,6 @@ export class API extends ParentAPI { listProcesses = (request: Readonly = {}) => enrichForPagination('processes', this.pageOfListProcesses, request) - /** * Update process information. Update process information of the provided **process ID**. * @@ -576,7 +601,6 @@ export class API extends ParentAPI { unmarshalProcess, ) - /** * Cancel a running process. Cancel a process by its unique ID. Intermediate results are still available. * @@ -594,22 +618,20 @@ export class API extends ParentAPI { unmarshalProcess, ) - /** * Delete an existing process. Delete a process by its unique ID and delete all its data. * * @param request - The request {@link DeleteProcessRequest} */ deleteProcess = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/qaas/v1alpha1/processes/${validatePathParam('processId', request.processId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/qaas/v1alpha1/processes/${validatePathParam('processId', request.processId)}`, + }) - - protected pageOfListProcessResults = (request: Readonly) => + protected pageOfListProcessResults = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -617,12 +639,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListProcessResultsResponse, ) - + /** * List all results of a process. Retrieve all intermediate and final result of a process. * @@ -630,9 +655,12 @@ export class API extends ParentAPI { * @returns A Promise of ListProcessResultsResponse */ listProcessResults = (request: Readonly) => - enrichForPagination('processResults', this.pageOfListProcessResults, request) + enrichForPagination( + 'processResults', + this.pageOfListProcessResults, + request, + ) - /** * Get application information. Retrieve information about the provided **application ID**, such as name, type and compatible platforms. * @@ -648,8 +676,9 @@ export class API extends ParentAPI { unmarshalApplication, ) - - protected pageOfListApplications = (request: Readonly = {}) => + protected pageOfListApplications = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -659,12 +688,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListApplicationsResponse, ) - + /** * List all available applications. Retrieve information about all applications. * @@ -674,7 +706,6 @@ export class API extends ParentAPI { listApplications = (request: Readonly = {}) => enrichForPagination('applications', this.pageOfListApplications, request) - /** * Get booking information. Retrieve information about the provided **booking ID**, such as description, status and progress message. * @@ -689,7 +720,7 @@ export class API extends ParentAPI { }, unmarshalBooking, ) - + /** * Waits for {@link Booking} to be in a final state. * @@ -702,14 +733,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!BOOKING_TRANSIENT_STATUSES_QAAS.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !BOOKING_TRANSIENT_STATUSES_QAAS.includes(res.status), + )), this.getBooking, request, options, ) - - protected pageOfListBookings = (request: Readonly = {}) => + protected pageOfListBookings = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -717,14 +753,17 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['platform_id', request.platformId], ['project_id', request.projectId], ), }, unmarshalListBookingsResponse, ) - + /** * List all bookings according the filter. Retrieve information about all bookings of the provided **project ID** or ** platform ID**. * @@ -734,7 +773,6 @@ export class API extends ParentAPI { listBookings = (request: Readonly = {}) => enrichForPagination('bookings', this.pageOfListBookings, request) - /** * Update booking information. Update booking information of the provided **booking ID**. * @@ -754,7 +792,6 @@ export class API extends ParentAPI { unmarshalBooking, ) - /** * Create a new model. Create and register a new model that can be executed through next jobs. A model can also be assigned to a Session. * @@ -774,7 +811,6 @@ export class API extends ParentAPI { unmarshalModel, ) - /** * Get model information. Retrieve information about of the provided **model ID**. * @@ -790,7 +826,6 @@ export class API extends ParentAPI { unmarshalModel, ) - protected pageOfListModels = (request: Readonly = {}) => this.client.fetch( { @@ -799,13 +834,19 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListModelsResponse, ) - + /** * List all models attached to the **project ID**. Retrieve information about all models of the provided **project ID**. * @@ -814,7 +855,4 @@ export class API extends ParentAPI { */ listModels = (request: Readonly = {}) => enrichForPagination('models', this.pageOfListModels, request) - - } - diff --git a/packages_generated/qaas/src/v1alpha1/content.gen.ts b/packages_generated/qaas/src/v1alpha1/content.gen.ts index a3dcb614d..67ac37543 100644 --- a/packages_generated/qaas/src/v1alpha1/content.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/content.gen.ts @@ -7,7 +7,6 @@ import type { SessionStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link BookingStatus}. */ export const BOOKING_TRANSIENT_STATUSES: BookingStatus[] = [ 'waiting', @@ -34,4 +33,3 @@ export const SESSION_TRANSIENT_STATUSES: SessionStatus[] = [ 'starting', 'stopping', ] - diff --git a/packages_generated/qaas/src/v1alpha1/index.gen.ts b/packages_generated/qaas/src/v1alpha1/index.gen.ts index e15b83fc0..61631d548 100644 --- a/packages_generated/qaas/src/v1alpha1/index.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts b/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts index 02165a20e..9684594c4 100644 --- a/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,10 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { JobCircuit, @@ -123,7 +128,9 @@ export const unmarshalModel = (data: unknown): Model => { } as Model } -const unmarshalPlatformBookingRequirement = (data: unknown): PlatformBookingRequirement => { +const unmarshalPlatformBookingRequirement = ( + data: unknown, +): PlatformBookingRequirement => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PlatformBookingRequirement' failed as data isn't a dictionary.`, @@ -168,10 +175,14 @@ export const unmarshalPlatform = (data: unknown): Platform => { return { availability: data.availability, backendName: data.backend_name, - bookingRequirement: data.booking_requirement ? unmarshalPlatformBookingRequirement(data.booking_requirement) : undefined, + bookingRequirement: data.booking_requirement + ? unmarshalPlatformBookingRequirement(data.booking_requirement) + : undefined, description: data.description, documentationUrl: data.documentation_url, - hardware: data.hardware ? unmarshalPlatformHardware(data.hardware) : undefined, + hardware: data.hardware + ? unmarshalPlatformHardware(data.hardware) + : undefined, id: data.id, isBookable: data.is_bookable, maxCircuitCount: data.max_circuit_count, @@ -179,9 +190,15 @@ export const unmarshalPlatform = (data: unknown): Platform => { maxShotCount: data.max_shot_count, metadata: data.metadata, name: data.name, - pricePerCircuit: data.price_per_circuit ? unmarshalMoney(data.price_per_circuit) : undefined, - pricePerHour: data.price_per_hour ? unmarshalMoney(data.price_per_hour) : undefined, - pricePerShot: data.price_per_shot ? unmarshalMoney(data.price_per_shot) : undefined, + pricePerCircuit: data.price_per_circuit + ? unmarshalMoney(data.price_per_circuit) + : undefined, + pricePerHour: data.price_per_hour + ? unmarshalMoney(data.price_per_hour) + : undefined, + pricePerShot: data.price_per_shot + ? unmarshalMoney(data.price_per_shot) + : undefined, providerName: data.provider_name, technology: data.technology, type: data.type, @@ -247,7 +264,9 @@ export const unmarshalSession = (data: unknown): Session => { } as Session } -export const unmarshalListApplicationsResponse = (data: unknown): ListApplicationsResponse => { +export const unmarshalListApplicationsResponse = ( + data: unknown, +): ListApplicationsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListApplicationsResponse' failed as data isn't a dictionary.`, @@ -255,12 +274,17 @@ export const unmarshalListApplicationsResponse = (data: unknown): ListApplicatio } return { - applications: unmarshalArrayOfObject(data.applications, unmarshalApplication), + applications: unmarshalArrayOfObject( + data.applications, + unmarshalApplication, + ), totalCount: data.total_count, } as ListApplicationsResponse } -export const unmarshalListBookingsResponse = (data: unknown): ListBookingsResponse => { +export const unmarshalListBookingsResponse = ( + data: unknown, +): ListBookingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBookingsResponse' failed as data isn't a dictionary.`, @@ -288,7 +312,9 @@ const unmarshalJobResult = (data: unknown): JobResult => { } as JobResult } -export const unmarshalListJobResultsResponse = (data: unknown): ListJobResultsResponse => { +export const unmarshalListJobResultsResponse = ( + data: unknown, +): ListJobResultsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListJobResultsResponse' failed as data isn't a dictionary.`, @@ -314,7 +340,9 @@ export const unmarshalListJobsResponse = (data: unknown): ListJobsResponse => { } as ListJobsResponse } -export const unmarshalListModelsResponse = (data: unknown): ListModelsResponse => { +export const unmarshalListModelsResponse = ( + data: unknown, +): ListModelsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListModelsResponse' failed as data isn't a dictionary.`, @@ -327,7 +355,9 @@ export const unmarshalListModelsResponse = (data: unknown): ListModelsResponse = } as ListModelsResponse } -export const unmarshalListPlatformsResponse = (data: unknown): ListPlatformsResponse => { +export const unmarshalListPlatformsResponse = ( + data: unknown, +): ListPlatformsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPlatformsResponse' failed as data isn't a dictionary.`, @@ -354,7 +384,9 @@ const unmarshalProcessResult = (data: unknown): ProcessResult => { } as ProcessResult } -export const unmarshalListProcessResultsResponse = (data: unknown): ListProcessResultsResponse => { +export const unmarshalListProcessResultsResponse = ( + data: unknown, +): ListProcessResultsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListProcessResultsResponse' failed as data isn't a dictionary.`, @@ -362,12 +394,17 @@ export const unmarshalListProcessResultsResponse = (data: unknown): ListProcessR } return { - processResults: unmarshalArrayOfObject(data.process_results, unmarshalProcessResult), + processResults: unmarshalArrayOfObject( + data.process_results, + unmarshalProcessResult, + ), totalCount: data.total_count, } as ListProcessResultsResponse } -export const unmarshalListProcessesResponse = (data: unknown): ListProcessesResponse => { +export const unmarshalListProcessesResponse = ( + data: unknown, +): ListProcessesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListProcessesResponse' failed as data isn't a dictionary.`, @@ -380,7 +417,9 @@ export const unmarshalListProcessesResponse = (data: unknown): ListProcessesResp } as ListProcessesResponse } -export const unmarshalListSessionACLsResponse = (data: unknown): ListSessionACLsResponse => { +export const unmarshalListSessionACLsResponse = ( + data: unknown, +): ListSessionACLsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSessionACLsResponse' failed as data isn't a dictionary.`, @@ -393,7 +432,9 @@ export const unmarshalListSessionACLsResponse = (data: unknown): ListSessionACLs } as ListSessionACLsResponse } -export const unmarshalListSessionsResponse = (data: unknown): ListSessionsResponse => { +export const unmarshalListSessionsResponse = ( + data: unknown, +): ListSessionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSessionsResponse' failed as data isn't a dictionary.`, @@ -409,14 +450,10 @@ export const unmarshalListSessionsResponse = (data: unknown): ListSessionsRespon const marshalJobCircuit = ( request: JobCircuit, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'perceval_circuit', - value: request.percevalCircuit, - }, - {param: 'qiskit_circuit', - value: request.qiskitCircuit, - }, + { param: 'perceval_circuit', value: request.percevalCircuit }, + { param: 'qiskit_circuit', value: request.qiskitCircuit }, ]), }) @@ -424,7 +461,7 @@ export const marshalCreateJobRequest = ( request: CreateJobRequest, defaults: DefaultValues, ): Record => ({ - circuit: marshalJobCircuit(request.circuit, defaults), + circuit: marshalJobCircuit(request.circuit, defaults), max_duration: request.maxDuration, model_id: request.modelId, name: request.name, @@ -467,7 +504,13 @@ export const marshalCreateSessionRequest = ( request: CreateSessionRequest, defaults: DefaultValues, ): Record => ({ - booking_demand: ((request.bookingDemand !== undefined) ? marshalCreateSessionRequestBookingDemand(request.bookingDemand, defaults): undefined), + booking_demand: + request.bookingDemand !== undefined + ? marshalCreateSessionRequestBookingDemand( + request.bookingDemand, + defaults, + ) + : undefined, deduplication_id: request.deduplicationId, max_duration: request.maxDuration, max_idle_duration: request.maxIdleDuration, diff --git a/packages_generated/qaas/src/v1alpha1/types.gen.ts b/packages_generated/qaas/src/v1alpha1/types.gen.ts index d8fa79f4a..a527a8680 100644 --- a/packages_generated/qaas/src/v1alpha1/types.gen.ts +++ b/packages_generated/qaas/src/v1alpha1/types.gen.ts @@ -1,11 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, } from '@scaleway/sdk-client' +import type { Money } from '@scaleway/sdk-client' - -export type ApplicationType = - | 'unknown_type' - | 'vqe' +export type ApplicationType = 'unknown_type' | 'vqe' export type BookingStatus = | 'unknown_status' @@ -37,9 +34,7 @@ export type ListBookingsRequestOrderBy = | 'started_at_desc' | 'started_at_asc' -export type ListJobResultsRequestOrderBy = - | 'created_at_desc' - | 'created_at_asc' +export type ListJobResultsRequestOrderBy = 'created_at_desc' | 'created_at_asc' export type ListJobsRequestOrderBy = | 'created_at_desc' @@ -53,9 +48,7 @@ export type ListJobsRequestOrderBy = | 'session_name_asc' | 'session_name_desc' -export type ListModelsRequestOrderBy = - | 'created_at_desc' - | 'created_at_asc' +export type ListModelsRequestOrderBy = 'created_at_desc' | 'created_at_asc' export type ListPlatformsRequestOrderBy = | 'name_asc' @@ -83,9 +76,7 @@ export type ListProcessesRequestOrderBy = | 'status_asc' | 'status_desc' -export type ListSessionACLsRequestOrderBy = - | 'access_asc' - | 'access_desc' +export type ListSessionACLsRequestOrderBy = 'access_asc' | 'access_desc' export type ListSessionsRequestOrderBy = | 'name_asc' @@ -112,10 +103,7 @@ export type PlatformTechnology = | 'superconducting' | 'neutral_atom' -export type PlatformType = - | 'unknown_type' - | 'simulator' - | 'qpu' +export type PlatformType = 'unknown_type' | 'simulator' | 'qpu' export type ProcessStatus = | 'unknown_status' @@ -136,10 +124,7 @@ export type SessionAccess = | 'read_job' | 'read_write_job' -export type SessionOriginType = - | 'unknown_origin_type' - | 'customer' - | 'process' +export type SessionOriginType = 'unknown_origin_type' | 'customer' | 'process' export type SessionStatus = | 'unknown_status' @@ -179,7 +164,6 @@ export interface PlatformBookingRequirement { maxBookingPerDay: number } - export interface PlatformHardware { /** * Product name of the hardware. @@ -207,7 +191,6 @@ export interface PlatformHardware { vram: number } - export interface JobCircuit { /** * Circuit generated by Perceval that should be executed. @@ -223,7 +206,6 @@ export interface JobCircuit { qiskitCircuit?: string } - export interface CreateSessionRequestBookingDemand { startedAt?: Date finishedAt?: Date @@ -231,7 +213,6 @@ export interface CreateSessionRequestBookingDemand { timeZone?: string } - export interface Application { /** * Unique ID of the application. @@ -255,7 +236,6 @@ export interface Application { inputTemplate: string } - export interface Booking { /** * Unique ID of the booking. @@ -295,7 +275,6 @@ export interface Booking { timeZone?: string } - export interface JobResult { /** * ID of the parent job. @@ -315,7 +294,6 @@ export interface JobResult { createdAt?: Date } - export interface Job { /** * Unique ID of the job. @@ -371,7 +349,6 @@ export interface Job { parameters?: string } - export interface Model { /** * Unique ID of the model. @@ -391,7 +368,6 @@ export interface Model { projectId: string } - export interface Platform { /** * Unique ID of the platform. @@ -475,7 +451,6 @@ export interface Platform { isBookable: boolean } - export interface ProcessResult { /** * ID of the parent process. @@ -491,7 +466,6 @@ export interface ProcessResult { createdAt?: Date } - export interface Process { /** * Unique ID of the process. @@ -555,7 +529,6 @@ export interface Process { input?: string } - export interface Session { /** * Unique ID of the session. @@ -643,7 +616,6 @@ export interface Session { parameters?: string } - export type CancelJobRequest = { /** * Unique ID of the job. @@ -651,7 +623,6 @@ export type CancelJobRequest = { jobId: string } - export type CancelProcessRequest = { /** * Unique ID of the process. @@ -659,7 +630,6 @@ export type CancelProcessRequest = { processId: string } - export type CreateJobRequest = { /** * Name of the job. @@ -691,7 +661,6 @@ export type CreateJobRequest = { parameters?: string } - export type CreateModelRequest = { /** * Project ID to attach this model. @@ -703,7 +672,6 @@ export type CreateModelRequest = { payload?: string } - export type CreateProcessRequest = { /** * ID of the project in which the process was created. @@ -731,7 +699,6 @@ export type CreateProcessRequest = { tags?: string[] } - export type CreateSessionRequest = { /** * ID of the Project in which the session was created. @@ -775,7 +742,6 @@ export type CreateSessionRequest = { parameters?: string } - export type DeleteJobRequest = { /** * Unique ID of the job. @@ -783,7 +749,6 @@ export type DeleteJobRequest = { jobId: string } - export type DeleteProcessRequest = { /** * Unique ID of the process. @@ -791,7 +756,6 @@ export type DeleteProcessRequest = { processId: string } - export type DeleteSessionRequest = { /** * Unique ID of the session. @@ -799,7 +763,6 @@ export type DeleteSessionRequest = { sessionId: string } - export type GetApplicationRequest = { /** * Unique ID of the application. @@ -807,7 +770,6 @@ export type GetApplicationRequest = { applicationId: string } - export type GetBookingRequest = { /** * Unique ID of the booking. @@ -815,7 +777,6 @@ export type GetBookingRequest = { bookingId: string } - export type GetJobCircuitRequest = { /** * Unique ID of the job. @@ -823,7 +784,6 @@ export type GetJobCircuitRequest = { jobId: string } - export type GetJobRequest = { /** * Unique ID of the job you want to get. @@ -831,7 +791,6 @@ export type GetJobRequest = { jobId: string } - export type GetModelRequest = { /** * Unique ID of the model. @@ -839,7 +798,6 @@ export type GetModelRequest = { modelId: string } - export type GetPlatformRequest = { /** * Unique ID of the platform. @@ -847,7 +805,6 @@ export type GetPlatformRequest = { platformId: string } - export type GetProcessRequest = { /** * Unique ID of the process. @@ -855,7 +812,6 @@ export type GetProcessRequest = { processId: string } - export type GetSessionRequest = { /** * Unique ID of the session. @@ -863,7 +819,6 @@ export type GetSessionRequest = { sessionId: string } - export type ListApplicationsRequest = { /** * List applications with this name. @@ -887,7 +842,6 @@ export type ListApplicationsRequest = { orderBy?: ListApplicationsRequestOrderBy } - export interface ListApplicationsResponse { /** * Total number of applications. @@ -899,7 +853,6 @@ export interface ListApplicationsResponse { applications: Application[] } - export type ListBookingsRequest = { /** * List bookings belonging to this project ID. @@ -923,7 +876,6 @@ export type ListBookingsRequest = { orderBy?: ListBookingsRequestOrderBy } - export interface ListBookingsResponse { /** * Total number of bookings. @@ -935,7 +887,6 @@ export interface ListBookingsResponse { bookings: Booking[] } - export type ListJobResultsRequest = { /** * ID of the job. @@ -955,7 +906,6 @@ export type ListJobResultsRequest = { orderBy?: ListJobResultsRequestOrderBy } - export interface ListJobResultsResponse { /** * Total number of results. @@ -967,7 +917,6 @@ export interface ListJobResultsResponse { jobResults: JobResult[] } - export type ListJobsRequest = { /** * List jobs with this session ID. @@ -999,7 +948,6 @@ export type ListJobsRequest = { orderBy?: ListJobsRequestOrderBy } - export interface ListJobsResponse { /** * Total number of jobs. @@ -1011,7 +959,6 @@ export interface ListJobsResponse { jobs: Job[] } - export type ListModelsRequest = { /** * List models belonging to this project ID. @@ -1031,7 +978,6 @@ export type ListModelsRequest = { orderBy?: ListModelsRequestOrderBy } - export interface ListModelsResponse { /** * Total number of models. @@ -1043,7 +989,6 @@ export interface ListModelsResponse { models: Model[] } - export type ListPlatformsRequest = { /** * List platforms with this provider name. @@ -1079,7 +1024,6 @@ export type ListPlatformsRequest = { orderBy?: ListPlatformsRequestOrderBy } - export interface ListPlatformsResponse { /** * Total number of platforms. @@ -1091,7 +1035,6 @@ export interface ListPlatformsResponse { platforms: Platform[] } - export type ListProcessResultsRequest = { /** * ID of the process. @@ -1111,7 +1054,6 @@ export type ListProcessResultsRequest = { orderBy?: ListProcessResultsRequestOrderBy } - export interface ListProcessResultsResponse { /** * Total number of results. @@ -1123,7 +1065,6 @@ export interface ListProcessResultsResponse { processResults: ProcessResult[] } - export type ListProcessesRequest = { /** * List processes that have been created for this application. @@ -1151,7 +1092,6 @@ export type ListProcessesRequest = { projectId?: string } - export interface ListProcessesResponse { /** * Total number of processes. @@ -1163,7 +1103,6 @@ export interface ListProcessesResponse { processes: Process[] } - export type ListSessionACLsRequest = { sessionId: string page?: number @@ -1171,13 +1110,11 @@ export type ListSessionACLsRequest = { orderBy?: ListSessionACLsRequestOrderBy } - export interface ListSessionACLsResponse { totalCount: number acls: SessionAccess[] } - export type ListSessionsRequest = { /** * List sessions that have been created for this platform. @@ -1205,7 +1142,6 @@ export type ListSessionsRequest = { projectId?: string } - export interface ListSessionsResponse { /** * Total number of sessions. @@ -1217,7 +1153,6 @@ export interface ListSessionsResponse { sessions: Session[] } - export type TerminateSessionRequest = { /** * Unique ID of the session. @@ -1225,7 +1160,6 @@ export type TerminateSessionRequest = { sessionId: string } - export type UpdateBookingRequest = { /** * Unique ID of the booking. @@ -1237,7 +1171,6 @@ export type UpdateBookingRequest = { description?: string } - export type UpdateJobRequest = { /** * Unique ID of the job. @@ -1253,7 +1186,6 @@ export type UpdateJobRequest = { tags?: string[] } - export type UpdateProcessRequest = { /** * Unique ID of the process. @@ -1269,7 +1201,6 @@ export type UpdateProcessRequest = { tags?: string[] } - export type UpdateSessionRequest = { /** * Unique ID of the session. @@ -1292,5 +1223,3 @@ export type UpdateSessionRequest = { */ tags?: string[] } - - diff --git a/packages_generated/rdb/src/v1/api.gen.ts b/packages_generated/rdb/src/v1/api.gen.ts index e2378957f..2dd41e823 100644 --- a/packages_generated/rdb/src/v1/api.gen.ts +++ b/packages_generated/rdb/src/v1/api.gen.ts @@ -8,8 +8,14 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DATABASE_BACKUP_TRANSIENT_STATUSES as DATABASE_BACKUP_TRANSIENT_STATUSES_RDB,INSTANCE_LOG_TRANSIENT_STATUSES as INSTANCE_LOG_TRANSIENT_STATUSES_RDB,INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_RDB,READ_REPLICA_TRANSIENT_STATUSES as READ_REPLICA_TRANSIENT_STATUSES_RDB,SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_RDB,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + DATABASE_BACKUP_TRANSIENT_STATUSES as DATABASE_BACKUP_TRANSIENT_STATUSES_RDB, + INSTANCE_LOG_TRANSIENT_STATUSES as INSTANCE_LOG_TRANSIENT_STATUSES_RDB, + INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_RDB, + READ_REPLICA_TRANSIENT_STATUSES as READ_REPLICA_TRANSIENT_STATUSES_RDB, + SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_RDB, +} from './content.gen.js' import { marshalAddInstanceACLRulesRequest, unmarshalAddInstanceACLRulesResponse, @@ -171,16 +177,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListDatabaseEngines = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListDatabaseEngines = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -188,13 +191,16 @@ export class API extends ParentAPI { urlParams: urlParams( ['name', request.name], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListDatabaseEnginesResponse, ) - + /** * List available database engines. List the PostgreSQL and MySQL database engines available at Scaleway. * @@ -204,7 +210,6 @@ export class API extends ParentAPI { listDatabaseEngines = (request: Readonly = {}) => enrichForPagination('engines', this.pageOfListDatabaseEngines, request) - protected pageOfListNodeTypes = (request: Readonly) => this.client.fetch( { @@ -213,12 +218,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['include_disabled_types', request.includeDisabledTypes], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -228,8 +236,9 @@ export class API extends ParentAPI { listNodeTypes = (request: Readonly) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - protected pageOfListDatabaseBackups = (request: Readonly = {}) => + protected pageOfListDatabaseBackups = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -240,13 +249,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListDatabaseBackupsResponse, ) - + /** * List database backups. List all backups in a specified region, for a given Scaleway Organization or Scaleway Project. By default, the backups listed are ordered by creation date in ascending order. This can be modified via the `order_by` field. * @@ -254,9 +266,12 @@ export class API extends ParentAPI { * @returns A Promise of ListDatabaseBackupsResponse */ listDatabaseBackups = (request: Readonly = {}) => - enrichForPagination('databaseBackups', this.pageOfListDatabaseBackups, request) + enrichForPagination( + 'databaseBackups', + this.pageOfListDatabaseBackups, + request, + ) - /** * Create a database backup. Create a new backup. You must set the `instance_id`, `database_name`, `name` and `expires_at` parameters. * @@ -276,7 +291,6 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - /** * Get a database backup. Retrieve information about a given backup, specified by its database backup ID and region. Full details about the backup, like size, URL and expiration date, are returned in the response. * @@ -291,7 +305,7 @@ export class API extends ParentAPI { }, unmarshalDatabaseBackup, ) - + /** * Waits for {@link DatabaseBackup} to be in a final state. * @@ -304,13 +318,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DATABASE_BACKUP_TRANSIENT_STATUSES_RDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DATABASE_BACKUP_TRANSIENT_STATUSES_RDB.includes(res.status), + )), this.getDatabaseBackup, request, options, ) - /** * Update a database backup. Update the parameters of a backup, including name and expiration date. * @@ -330,7 +347,6 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - /** * Delete a database backup. Delete a backup, specified by its database backup ID and region. Deleting a backup is permanent, and cannot be undone. * @@ -346,7 +362,6 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - /** * Restore a database backup. Launch the process of restoring database backup. You must specify the `instance_id` of the Database Instance of destination, where the backup will be restored. Note that large database backups can take up to several hours to restore. * @@ -366,7 +381,6 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - /** * Export a database backup. Export a backup, specified by the `database_backup_id` and the `region` parameters. The download URL is returned in the response. * @@ -384,7 +398,6 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - /** * Upgrade a Database Instance. Upgrade your current Database Instance specifications like node type, high availability, volume, or the database engine version. Note that upon upgrade the `enable_ha` parameter can only be set to `true`. * @@ -404,8 +417,9 @@ export class API extends ParentAPI { unmarshalInstance, ) - - protected pageOfListInstances = (request: Readonly = {}) => + protected pageOfListInstances = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -416,14 +430,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListInstancesResponse, ) - + /** * List Database Instances. List all Database Instances in the specified region, for a given Scaleway Organization or Scaleway Project. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags` and `name`. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -433,7 +450,6 @@ export class API extends ParentAPI { listInstances = (request: Readonly = {}) => enrichForPagination('instances', this.pageOfListInstances, request) - /** * Get a Database Instance. Retrieve information about a given Database Instance, specified by the `region` and `instance_id` parameters. Its full details, including name, status, IP address and port, are returned in the response object. * @@ -448,7 +464,7 @@ export class API extends ParentAPI { }, unmarshalInstance, ) - + /** * Waits for {@link Instance} to be in a final state. * @@ -461,13 +477,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!INSTANCE_TRANSIENT_STATUSES_RDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !INSTANCE_TRANSIENT_STATUSES_RDB.includes(res.status), + )), this.getInstance, request, options, ) - /** * Create a Database Instance. Create a new Database Instance. You must set the `engine`, `user_name`, `password` and `node_type` parameters. Optionally, you can specify the volume type and size. * @@ -487,7 +506,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Update a Database Instance. Update the parameters of a Database Instance, including name, tags and backup schedule details. * @@ -507,7 +525,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Delete a Database Instance. Delete a given Database Instance, specified by the `region` and `instance_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. * @@ -523,7 +540,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Clone a Database Instance. Clone a given Database Instance, specified by the `region` and `instance_id` parameters. The clone feature allows you to create a new Database Instance from an existing one. The clone includes all existing databases, users and permissions. You can create a clone on a Database Instance bigger than your current one. * @@ -543,7 +559,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Restart Database Instance. Restart a given Database Instance, specified by the `region` and `instance_id` parameters. The status of the Database Instance returned in the response. * @@ -561,7 +576,6 @@ export class API extends ParentAPI { unmarshalInstance, ) - /** * Get the TLS certificate of a Database Instance. Retrieve information about the TLS certificate of a given Database Instance. Details like name and content are returned in the response. * @@ -569,34 +583,28 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ getInstanceCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Renew the TLS certificate of a Database Instance. Renew a TLS for a Database Instance. Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients. * * @param request - The request {@link RenewInstanceCertificateRequest} */ - renewInstanceCertificate = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate`, - }, - ) + renewInstanceCertificate = ( + request: Readonly, + ) => + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/renew-certificate`, + }) - /** * [deprecated] Get Database Instance metrics. Retrieve the time series metrics of a given Database Instance. You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`. This method is deprecated and will be removed in a future version. * @@ -618,7 +626,6 @@ export class API extends ParentAPI { unmarshalInstanceMetrics, ) - /** * Create a Read Replica. Create a new Read Replica of a Database Instance. You must specify the `region` and the `instance_id`. You can only create a maximum of 3 Read Replicas per Database Instance. * @@ -638,7 +645,6 @@ export class API extends ParentAPI { unmarshalReadReplica, ) - /** * Get a Read Replica. Retrieve information about a Database Instance Read Replica. Full details about the Read Replica, like `endpoints`, `status` and `region` are returned in the response. * @@ -653,7 +659,7 @@ export class API extends ParentAPI { }, unmarshalReadReplica, ) - + /** * Waits for {@link ReadReplica} to be in a final state. * @@ -666,13 +672,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!READ_REPLICA_TRANSIENT_STATUSES_RDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !READ_REPLICA_TRANSIENT_STATUSES_RDB.includes(res.status), + )), this.getReadReplica, request, options, ) - /** * Delete a Read Replica. Delete a Read Replica of a Database Instance. You must specify the `region` and `read_replica_id` parameters of the Read Replica you want to delete. * @@ -688,7 +697,6 @@ export class API extends ParentAPI { unmarshalReadReplica, ) - /** * Resync a Read Replica. When you resync a Read Replica, first it is reset, then its data is resynchronized from the primary node. Your Read Replica remains unavailable during the resync process. The duration of this process is proportional to the size of your Database Instance. The configured endpoints do not change. @@ -707,7 +715,6 @@ The configured endpoints do not change. unmarshalReadReplica, ) - /** * Promote a Read Replica. Promote a Read Replica to Database Instance automatically. * @@ -725,18 +732,22 @@ The configured endpoints do not change. unmarshalInstance, ) - /** * Create an endpoint for a Read Replica. Create a new endpoint for a Read Replica. Read Replicas can have at most one direct access and one Private Network endpoint. * * @param request - The request {@link CreateReadReplicaEndpointRequest} * @returns A Promise of ReadReplica */ - createReadReplicaEndpoint = (request: Readonly) => + createReadReplicaEndpoint = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalCreateReadReplicaEndpointRequest(request, this.client.settings), + marshalCreateReadReplicaEndpointRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -745,7 +756,6 @@ The configured endpoints do not change. unmarshalReadReplica, ) - /** * Prepare logs of a Database Instance. Prepare your Database Instance logs. You can define the `start_date` and `end_date` parameters for your query. The download URL is returned in the response. Logs are recorded from 00h00 to 23h59 and then aggregated in a `.log` file once a day. Therefore, even if you specify a timeframe from which you want to get the logs, you will receive logs from the full 24 hours. * @@ -765,7 +775,6 @@ The configured endpoints do not change. unmarshalPrepareInstanceLogsResponse, ) - /** * List available logs of a Database Instance. List the available logs of a Database Instance. By default, the logs returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. * @@ -777,14 +786,11 @@ The configured endpoints do not change. { method: 'GET', path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/logs`, - urlParams: urlParams( - ['order_by', request.orderBy], - ), + urlParams: urlParams(['order_by', request.orderBy]), }, unmarshalListInstanceLogsResponse, ) - /** * Get given logs of a Database Instance. Retrieve information about the logs of a Database Instance. Specify the `instance_log_id` and `region` in your request to get information such as `download_url`, `status`, `expires_at` and `created_at` about your logs in the response. * @@ -799,7 +805,7 @@ The configured endpoints do not change. }, unmarshalInstanceLog, ) - + /** * Waits for {@link InstanceLog} to be in a final state. * @@ -812,38 +818,40 @@ The configured endpoints do not change. options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!INSTANCE_LOG_TRANSIENT_STATUSES_RDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !INSTANCE_LOG_TRANSIENT_STATUSES_RDB.includes(res.status), + )), this.getInstanceLog, request, options, ) - /** * Purge remote Database Instance logs. Purge a given remote log from a Database Instance. You can specify the `log_name` of the log you wish to clean from your Database Instance. * * @param request - The request {@link PurgeInstanceLogsRequest} */ purgeInstanceLogs = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalPurgeInstanceLogsRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalPurgeInstanceLogsRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/purge-logs`, + }) - /** * List remote Database Instance logs details. List remote log details. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. * * @param request - The request {@link ListInstanceLogsDetailsRequest} * @returns A Promise of ListInstanceLogsDetailsResponse */ - listInstanceLogsDetails = (request: Readonly) => + listInstanceLogsDetails = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -852,7 +860,6 @@ The configured endpoints do not change. unmarshalListInstanceLogsDetailsResponse, ) - /** * Add Database Instance advanced settings. Add an advanced setting to a Database Instance. You must set the `name` and the `value` of each setting. * @@ -872,7 +879,6 @@ The configured endpoints do not change. unmarshalAddInstanceSettingsResponse, ) - /** * Delete Database Instance advanced settings. Delete an advanced setting in a Database Instance. You must specify the names of the settings you want to delete in the request. * @@ -892,7 +898,6 @@ The configured endpoints do not change. unmarshalDeleteInstanceSettingsResponse, ) - /** * Set Database Instance advanced settings. Update an advanced setting for a Database Instance. Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated. * @@ -912,20 +917,24 @@ The configured endpoints do not change. unmarshalSetInstanceSettingsResponse, ) - - protected pageOfListInstanceACLRules = (request: Readonly) => + protected pageOfListInstanceACLRules = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/acls`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListInstanceACLRulesResponse, ) - + /** * List ACL rules of a Database Instance. List the ACL rules for a given Database Instance. The response is an array of ACL objects, each one representing an ACL that denies, allows or redirects traffic based on certain conditions. * @@ -935,7 +944,6 @@ The configured endpoints do not change. listInstanceACLRules = (request: Readonly) => enrichForPagination('rules', this.pageOfListInstanceACLRules, request) - /** * Add an ACL rule to a Database Instance. Add an additional ACL rule to a Database Instance. * @@ -955,7 +963,6 @@ The configured endpoints do not change. unmarshalAddInstanceACLRulesResponse, ) - /** * Set ACL rules for a Database Instance. Replace all the ACL rules of a Database Instance. * @@ -975,7 +982,6 @@ The configured endpoints do not change. unmarshalSetInstanceACLRulesResponse, ) - /** * Delete ACL rules of a Database Instance. Delete one or more ACL rules of a Database Instance. * @@ -995,7 +1001,6 @@ The configured endpoints do not change. unmarshalDeleteInstanceACLRulesResponse, ) - protected pageOfListUsers = (request: Readonly) => this.client.fetch( { @@ -1005,12 +1010,15 @@ The configured endpoints do not change. ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListUsersResponse, ) - + /** * List users of a Database Instance. List all users of a given Database Instance. By default, the users returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. * @@ -1020,7 +1028,6 @@ The configured endpoints do not change. listUsers = (request: Readonly) => enrichForPagination('users', this.pageOfListUsers, request) - /** * Create a user for a Database Instance. Create a new user for a Database Instance. You must define the `name`, `password` and `is_admin` parameters. * @@ -1040,7 +1047,6 @@ The configured endpoints do not change. unmarshalUser, ) - /** * Update a user on a Database Instance. Update the parameters of a user on a Database Instance. You can update the `password` and `is_admin` parameters, but you cannot change the name of the user. * @@ -1060,21 +1066,17 @@ The configured endpoints do not change. unmarshalUser, ) - /** * Delete a user on a Database Instance. Delete a given user on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the user you want to delete. * * @param request - The request {@link DeleteUserRequest} */ deleteUser = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/users/${validatePathParam('name', request.name)}`, + }) - protected pageOfListDatabases = (request: Readonly) => this.client.fetch( { @@ -1086,13 +1088,16 @@ The configured endpoints do not change. ['order_by', request.orderBy], ['owner', request.owner], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['skip_size_retrieval', request.skipSizeRetrieval], ), }, unmarshalListDatabasesResponse, ) - + /** * List databases in a Database Instance. List all databases of a given Database Instance. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `name`, `managed` and `owner`. * @@ -1102,7 +1107,6 @@ The configured endpoints do not change. listDatabases = (request: Readonly) => enrichForPagination('databases', this.pageOfListDatabases, request) - /** * Create a database in a Database Instance. Create a new database. You must define the `name` parameter in the request. * @@ -1122,21 +1126,17 @@ The configured endpoints do not change. unmarshalDatabase, ) - /** * Delete a database in a Database Instance. Delete a given database on a Database Instance. You must specify, in the endpoint, the `region`, `instance_id` and `name` parameters of the database you want to delete. * * @param request - The request {@link DeleteDatabaseRequest} */ deleteDatabase = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/instances/${validatePathParam('instanceId', request.instanceId)}/databases/${validatePathParam('name', request.name)}`, + }) - protected pageOfListPrivileges = (request: Readonly) => this.client.fetch( { @@ -1146,13 +1146,16 @@ The configured endpoints do not change. ['database_name', request.databaseName], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['user_name', request.userName], ), }, unmarshalListPrivilegesResponse, ) - + /** * List user privileges for a database. List privileges of a user on a database. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `database_name` and `user_name`. * @@ -1162,7 +1165,6 @@ The configured endpoints do not change. listPrivileges = (request: Readonly) => enrichForPagination('privileges', this.pageOfListPrivileges, request) - /** * Set user privileges for a database. Set the privileges of a user on a database. You must define `database_name`, `user_name` and `permission` in the request body. * @@ -1182,8 +1184,9 @@ The configured endpoints do not change. unmarshalPrivilege, ) - - protected pageOfListSnapshots = (request: Readonly = {}) => + protected pageOfListSnapshots = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -1194,13 +1197,16 @@ The configured endpoints do not change. ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListSnapshotsResponse, ) - + /** * List snapshots. List snapshots. You can include the `instance_id` or `project_id` in your query to get the list of snapshots for specific Database Instances and/or Projects. By default, the details returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -1210,7 +1216,6 @@ The configured endpoints do not change. listSnapshots = (request: Readonly = {}) => enrichForPagination('snapshots', this.pageOfListSnapshots, request) - /** * Get a Database Instance snapshot. Retrieve information about a given snapshot, specified by its `snapshot_id` and `region`. Full details about the snapshot, like size and expiration date, are returned in the response. * @@ -1225,7 +1230,7 @@ The configured endpoints do not change. }, unmarshalSnapshot, ) - + /** * Waits for {@link Snapshot} to be in a final state. * @@ -1238,13 +1243,16 @@ The configured endpoints do not change. options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!SNAPSHOT_TRANSIENT_STATUSES_RDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !SNAPSHOT_TRANSIENT_STATUSES_RDB.includes(res.status), + )), this.getSnapshot, request, options, ) - /** * Create a Database Instance snapshot. Create a new snapshot of a Database Instance. You must define the `name` parameter in the request. * @@ -1264,7 +1272,6 @@ The configured endpoints do not change. unmarshalSnapshot, ) - /** * Update a Database Instance snapshot. Update the parameters of a snapshot of a Database Instance. You can update the `name` and `expires_at` parameters. * @@ -1284,7 +1291,6 @@ The configured endpoints do not change. unmarshalSnapshot, ) - /** * Delete a Database Instance snapshot. Delete a given snapshot of a Database Instance. You must specify, in the endpoint, the `region` and `snapshot_id` parameters of the snapshot you want to delete. * @@ -1300,18 +1306,22 @@ The configured endpoints do not change. unmarshalSnapshot, ) - /** * Create a new Database Instance from a snapshot. Restore a snapshot. When you restore a snapshot, a new Instance is created and billed to your account. Note that is possible to select a larger node type for your new Database Instance. However, the Block volume size will be the same as the size of the restored snapshot. All Instance settings will be restored if you chose a node type with the same or more memory size than the initial Instance. Settings will be reset to the default if your node type has less memory. * * @param request - The request {@link CreateInstanceFromSnapshotRequest} * @returns A Promise of Instance */ - createInstanceFromSnapshot = (request: Readonly) => + createInstanceFromSnapshot = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalCreateInstanceFromSnapshotRequest(request, this.client.settings), + marshalCreateInstanceFromSnapshotRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1320,7 +1330,6 @@ The configured endpoints do not change. unmarshalInstance, ) - /** * Create a new Database Instance endpoint. Create a new endpoint for a Database Instance. You can add `load_balancer` and `private_network` specifications to the body of the request. * @@ -1340,21 +1349,17 @@ The configured endpoints do not change. unmarshalEndpoint, ) - /** * Delete a Database Instance endpoint. Delete the endpoint of a Database Instance. You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint. * * @param request - The request {@link DeleteEndpointRequest} */ deleteEndpoint = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/rdb/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/endpoints/${validatePathParam('endpointId', request.endpointId)}`, + }) - /** * Get a Database Instance endpoint. Retrieve information about a Database Instance endpoint. Full details about the endpoint, like `ip`, `port`, `private_network` and `load_balancer` specifications are returned in the response. * @@ -1370,7 +1375,6 @@ The configured endpoints do not change. unmarshalEndpoint, ) - /** * Migrate an existing instance endpoint to another instance. * @@ -1390,14 +1394,15 @@ The configured endpoints do not change. unmarshalEndpoint, ) - /** * Apply Database Instance maintenance. Apply maintenance tasks to your Database Instance. This will trigger pending maintenance tasks to start in your Database Instance and can generate service interruption. Maintenance tasks can be applied between `starts_at` and `stops_at` times, and are run directly by Scaleway at `forced_at` timestamp. * * @param request - The request {@link ApplyInstanceMaintenanceRequest} * @returns A Promise of Maintenance */ - applyInstanceMaintenance = (request: Readonly) => + applyInstanceMaintenance = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -1407,7 +1412,4 @@ The configured endpoints do not change. }, unmarshalMaintenance, ) - - } - diff --git a/packages_generated/rdb/src/v1/content.gen.ts b/packages_generated/rdb/src/v1/content.gen.ts index 5a0adef9c..d0e0f5efa 100644 --- a/packages_generated/rdb/src/v1/content.gen.ts +++ b/packages_generated/rdb/src/v1/content.gen.ts @@ -9,7 +9,6 @@ import type { SnapshotStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link DatabaseBackupStatus}. */ export const DATABASE_BACKUP_TRANSIENT_STATUSES: DatabaseBackupStatus[] = [ 'creating', @@ -19,9 +18,7 @@ export const DATABASE_BACKUP_TRANSIENT_STATUSES: DatabaseBackupStatus[] = [ ] /** Lists transient statutes of the enum {@link InstanceLogStatus}. */ -export const INSTANCE_LOG_TRANSIENT_STATUSES: InstanceLogStatus[] = [ - 'creating', -] +export const INSTANCE_LOG_TRANSIENT_STATUSES: InstanceLogStatus[] = ['creating'] /** Lists transient statutes of the enum {@link InstanceStatus}. */ export const INSTANCE_TRANSIENT_STATUSES: InstanceStatus[] = [ @@ -36,9 +33,7 @@ export const INSTANCE_TRANSIENT_STATUSES: InstanceStatus[] = [ ] /** Lists transient statutes of the enum {@link MaintenanceStatus}. */ -export const MAINTENANCE_TRANSIENT_STATUSES: MaintenanceStatus[] = [ - 'ongoing', -] +export const MAINTENANCE_TRANSIENT_STATUSES: MaintenanceStatus[] = ['ongoing'] /** Lists transient statutes of the enum {@link ReadReplicaStatus}. */ export const READ_REPLICA_TRANSIENT_STATUSES: ReadReplicaStatus[] = [ @@ -55,4 +50,3 @@ export const SNAPSHOT_TRANSIENT_STATUSES: SnapshotStatus[] = [ 'restoring', 'deleting', ] - diff --git a/packages_generated/rdb/src/v1/index.gen.ts b/packages_generated/rdb/src/v1/index.gen.ts index 9d856f2eb..a2847b9bd 100644 --- a/packages_generated/rdb/src/v1/index.gen.ts +++ b/packages_generated/rdb/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/rdb/src/v1/marshalling.gen.ts b/packages_generated/rdb/src/v1/marshalling.gen.ts index 9adae1f2f..69d1da758 100644 --- a/packages_generated/rdb/src/v1/marshalling.gen.ts +++ b/packages_generated/rdb/src/v1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalTimeSeries, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EndpointDirectAccessDetails, @@ -89,29 +95,33 @@ import type { UpgradeInstanceRequest, } from './types.gen.js' -const unmarshalEndpointDirectAccessDetails = (data: unknown): EndpointDirectAccessDetails => { +const unmarshalEndpointDirectAccessDetails = ( + data: unknown, +): EndpointDirectAccessDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointDirectAccessDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointDirectAccessDetails + return {} as EndpointDirectAccessDetails } -const unmarshalEndpointLoadBalancerDetails = (data: unknown): EndpointLoadBalancerDetails => { +const unmarshalEndpointLoadBalancerDetails = ( + data: unknown, +): EndpointLoadBalancerDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointLoadBalancerDetails' failed as data isn't a dictionary.`, ) } - return { - } as EndpointLoadBalancerDetails + return {} as EndpointLoadBalancerDetails } -const unmarshalEndpointPrivateNetworkDetails = (data: unknown): EndpointPrivateNetworkDetails => { +const unmarshalEndpointPrivateNetworkDetails = ( + data: unknown, +): EndpointPrivateNetworkDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'EndpointPrivateNetworkDetails' failed as data isn't a dictionary.`, @@ -134,14 +144,20 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { } return { - directAccess: data.direct_access ? unmarshalEndpointDirectAccessDetails(data.direct_access) : undefined, + directAccess: data.direct_access + ? unmarshalEndpointDirectAccessDetails(data.direct_access) + : undefined, hostname: data.hostname, id: data.id, ip: data.ip, - loadBalancer: data.load_balancer ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) : undefined, + loadBalancer: data.load_balancer + ? unmarshalEndpointLoadBalancerDetails(data.load_balancer) + : undefined, name: data.name, port: data.port, - privateNetwork: data.private_network ? unmarshalEndpointPrivateNetworkDetails(data.private_network) : undefined, + privateNetwork: data.private_network + ? unmarshalEndpointPrivateNetworkDetails(data.private_network) + : undefined, } as Endpoint } @@ -329,27 +345,45 @@ export const unmarshalInstance = (data: unknown): Instance => { return { backupSameRegion: data.backup_same_region, - backupSchedule: data.backup_schedule ? unmarshalBackupSchedule(data.backup_schedule) : undefined, + backupSchedule: data.backup_schedule + ? unmarshalBackupSchedule(data.backup_schedule) + : undefined, createdAt: unmarshalDate(data.created_at), - encryption: data.encryption ? unmarshalEncryptionAtRest(data.encryption) : undefined, + encryption: data.encryption + ? unmarshalEncryptionAtRest(data.encryption) + : undefined, endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined, endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), engine: data.engine, id: data.id, - initSettings: unmarshalArrayOfObject(data.init_settings, unmarshalInstanceSetting), + initSettings: unmarshalArrayOfObject( + data.init_settings, + unmarshalInstanceSetting, + ), isHaCluster: data.is_ha_cluster, - logsPolicy: data.logs_policy ? unmarshalLogsPolicy(data.logs_policy) : undefined, - maintenances: unmarshalArrayOfObject(data.maintenances, unmarshalMaintenance), + logsPolicy: data.logs_policy + ? unmarshalLogsPolicy(data.logs_policy) + : undefined, + maintenances: unmarshalArrayOfObject( + data.maintenances, + unmarshalMaintenance, + ), name: data.name, nodeType: data.node_type, organizationId: data.organization_id, projectId: data.project_id, - readReplicas: unmarshalArrayOfObject(data.read_replicas, unmarshalReadReplica), + readReplicas: unmarshalArrayOfObject( + data.read_replicas, + unmarshalReadReplica, + ), region: data.region, settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting), status: data.status, tags: data.tags, - upgradableVersion: unmarshalArrayOfObject(data.upgradable_version, unmarshalUpgradableVersion), + upgradableVersion: unmarshalArrayOfObject( + data.upgradable_version, + unmarshalUpgradableVersion, + ), volume: data.volume ? unmarshalVolume(data.volume) : undefined, } as Instance } @@ -400,7 +434,9 @@ export const unmarshalSnapshot = (data: unknown): Snapshot => { size: data.size, status: data.status, updatedAt: unmarshalDate(data.updated_at), - volumeType: data.volume_type ? unmarshalSnapshotVolumeType(data.volume_type) : undefined, + volumeType: data.volume_type + ? unmarshalSnapshotVolumeType(data.volume_type) + : undefined, } as Snapshot } @@ -434,7 +470,9 @@ export const unmarshalACLRule = (data: unknown): ACLRule => { } as ACLRule } -export const unmarshalAddInstanceACLRulesResponse = (data: unknown): AddInstanceACLRulesResponse => { +export const unmarshalAddInstanceACLRulesResponse = ( + data: unknown, +): AddInstanceACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddInstanceACLRulesResponse' failed as data isn't a dictionary.`, @@ -446,7 +484,9 @@ export const unmarshalAddInstanceACLRulesResponse = (data: unknown): AddInstance } as AddInstanceACLRulesResponse } -export const unmarshalAddInstanceSettingsResponse = (data: unknown): AddInstanceSettingsResponse => { +export const unmarshalAddInstanceSettingsResponse = ( + data: unknown, +): AddInstanceSettingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddInstanceSettingsResponse' failed as data isn't a dictionary.`, @@ -458,7 +498,9 @@ export const unmarshalAddInstanceSettingsResponse = (data: unknown): AddInstance } as AddInstanceSettingsResponse } -export const unmarshalDeleteInstanceACLRulesResponse = (data: unknown): DeleteInstanceACLRulesResponse => { +export const unmarshalDeleteInstanceACLRulesResponse = ( + data: unknown, +): DeleteInstanceACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteInstanceACLRulesResponse' failed as data isn't a dictionary.`, @@ -470,7 +512,9 @@ export const unmarshalDeleteInstanceACLRulesResponse = (data: unknown): DeleteIn } as DeleteInstanceACLRulesResponse } -export const unmarshalDeleteInstanceSettingsResponse = (data: unknown): DeleteInstanceSettingsResponse => { +export const unmarshalDeleteInstanceSettingsResponse = ( + data: unknown, +): DeleteInstanceSettingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteInstanceSettingsResponse' failed as data isn't a dictionary.`, @@ -494,7 +538,9 @@ export const unmarshalInstanceMetrics = (data: unknown): InstanceMetrics => { } as InstanceMetrics } -export const unmarshalListDatabaseBackupsResponse = (data: unknown): ListDatabaseBackupsResponse => { +export const unmarshalListDatabaseBackupsResponse = ( + data: unknown, +): ListDatabaseBackupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`, @@ -502,7 +548,10 @@ export const unmarshalListDatabaseBackupsResponse = (data: unknown): ListDatabas } return { - databaseBackups: unmarshalArrayOfObject(data.database_backups, unmarshalDatabaseBackup), + databaseBackups: unmarshalArrayOfObject( + data.database_backups, + unmarshalDatabaseBackup, + ), totalCount: data.total_count, } as ListDatabaseBackupsResponse } @@ -537,8 +586,14 @@ const unmarshalEngineVersion = (data: unknown): EngineVersion => { } return { - availableInitSettings: unmarshalArrayOfObject(data.available_init_settings, unmarshalEngineSetting), - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalEngineSetting), + availableInitSettings: unmarshalArrayOfObject( + data.available_init_settings, + unmarshalEngineSetting, + ), + availableSettings: unmarshalArrayOfObject( + data.available_settings, + unmarshalEngineSetting, + ), beta: data.beta, disabled: data.disabled, endOfLife: unmarshalDate(data.end_of_life), @@ -562,7 +617,9 @@ const unmarshalDatabaseEngine = (data: unknown): DatabaseEngine => { } as DatabaseEngine } -export const unmarshalListDatabaseEnginesResponse = (data: unknown): ListDatabaseEnginesResponse => { +export const unmarshalListDatabaseEnginesResponse = ( + data: unknown, +): ListDatabaseEnginesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabaseEnginesResponse' failed as data isn't a dictionary.`, @@ -575,7 +632,9 @@ export const unmarshalListDatabaseEnginesResponse = (data: unknown): ListDatabas } as ListDatabaseEnginesResponse } -export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResponse => { +export const unmarshalListDatabasesResponse = ( + data: unknown, +): ListDatabasesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`, @@ -588,7 +647,9 @@ export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResp } as ListDatabasesResponse } -export const unmarshalListInstanceACLRulesResponse = (data: unknown): ListInstanceACLRulesResponse => { +export const unmarshalListInstanceACLRulesResponse = ( + data: unknown, +): ListInstanceACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceACLRulesResponse' failed as data isn't a dictionary.`, @@ -601,7 +662,9 @@ export const unmarshalListInstanceACLRulesResponse = (data: unknown): ListInstan } as ListInstanceACLRulesResponse } -const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data: unknown): ListInstanceLogsDetailsResponseInstanceLogDetail => { +const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = ( + data: unknown, +): ListInstanceLogsDetailsResponseInstanceLogDetail => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceLogsDetailsResponseInstanceLogDetail' failed as data isn't a dictionary.`, @@ -614,7 +677,9 @@ const unmarshalListInstanceLogsDetailsResponseInstanceLogDetail = (data: unknown } as ListInstanceLogsDetailsResponseInstanceLogDetail } -export const unmarshalListInstanceLogsDetailsResponse = (data: unknown): ListInstanceLogsDetailsResponse => { +export const unmarshalListInstanceLogsDetailsResponse = ( + data: unknown, +): ListInstanceLogsDetailsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceLogsDetailsResponse' failed as data isn't a dictionary.`, @@ -622,11 +687,16 @@ export const unmarshalListInstanceLogsDetailsResponse = (data: unknown): ListIns } return { - details: unmarshalArrayOfObject(data.details, unmarshalListInstanceLogsDetailsResponseInstanceLogDetail), + details: unmarshalArrayOfObject( + data.details, + unmarshalListInstanceLogsDetailsResponseInstanceLogDetail, + ), } as ListInstanceLogsDetailsResponse } -export const unmarshalListInstanceLogsResponse = (data: unknown): ListInstanceLogsResponse => { +export const unmarshalListInstanceLogsResponse = ( + data: unknown, +): ListInstanceLogsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstanceLogsResponse' failed as data isn't a dictionary.`, @@ -634,11 +704,16 @@ export const unmarshalListInstanceLogsResponse = (data: unknown): ListInstanceLo } return { - instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog), + instanceLogs: unmarshalArrayOfObject( + data.instance_logs, + unmarshalInstanceLog, + ), } as ListInstanceLogsResponse } -export const unmarshalListInstancesResponse = (data: unknown): ListInstancesResponse => { +export const unmarshalListInstancesResponse = ( + data: unknown, +): ListInstancesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListInstancesResponse' failed as data isn't a dictionary.`, @@ -651,7 +726,9 @@ export const unmarshalListInstancesResponse = (data: unknown): ListInstancesResp } as ListInstancesResponse } -const unmarshalNodeTypeVolumeConstraintSizes = (data: unknown): NodeTypeVolumeConstraintSizes => { +const unmarshalNodeTypeVolumeConstraintSizes = ( + data: unknown, +): NodeTypeVolumeConstraintSizes => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'NodeTypeVolumeConstraintSizes' failed as data isn't a dictionary.`, @@ -689,7 +766,10 @@ const unmarshalNodeType = (data: unknown): NodeType => { } return { - availableVolumeTypes: unmarshalArrayOfObject(data.available_volume_types, unmarshalNodeTypeVolumeType), + availableVolumeTypes: unmarshalArrayOfObject( + data.available_volume_types, + unmarshalNodeTypeVolumeType, + ), beta: data.beta, description: data.description, disabled: data.disabled, @@ -702,11 +782,15 @@ const unmarshalNodeType = (data: unknown): NodeType => { region: data.region, stockStatus: data.stock_status, vcpus: data.vcpus, - volumeConstraint: data.volume_constraint ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) : undefined, + volumeConstraint: data.volume_constraint + ? unmarshalNodeTypeVolumeConstraintSizes(data.volume_constraint) + : undefined, } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -719,7 +803,9 @@ export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResp } as ListNodeTypesResponse } -export const unmarshalListPrivilegesResponse = (data: unknown): ListPrivilegesResponse => { +export const unmarshalListPrivilegesResponse = ( + data: unknown, +): ListPrivilegesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPrivilegesResponse' failed as data isn't a dictionary.`, @@ -732,7 +818,9 @@ export const unmarshalListPrivilegesResponse = (data: unknown): ListPrivilegesRe } as ListPrivilegesResponse } -export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResponse => { +export const unmarshalListSnapshotsResponse = ( + data: unknown, +): ListSnapshotsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSnapshotsResponse' failed as data isn't a dictionary.`, @@ -745,7 +833,9 @@ export const unmarshalListSnapshotsResponse = (data: unknown): ListSnapshotsResp } as ListSnapshotsResponse } -export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => { +export const unmarshalListUsersResponse = ( + data: unknown, +): ListUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListUsersResponse' failed as data isn't a dictionary.`, @@ -758,7 +848,9 @@ export const unmarshalListUsersResponse = (data: unknown): ListUsersResponse => } as ListUsersResponse } -export const unmarshalPrepareInstanceLogsResponse = (data: unknown): PrepareInstanceLogsResponse => { +export const unmarshalPrepareInstanceLogsResponse = ( + data: unknown, +): PrepareInstanceLogsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PrepareInstanceLogsResponse' failed as data isn't a dictionary.`, @@ -766,11 +858,16 @@ export const unmarshalPrepareInstanceLogsResponse = (data: unknown): PrepareInst } return { - instanceLogs: unmarshalArrayOfObject(data.instance_logs, unmarshalInstanceLog), + instanceLogs: unmarshalArrayOfObject( + data.instance_logs, + unmarshalInstanceLog, + ), } as PrepareInstanceLogsResponse } -export const unmarshalSetInstanceACLRulesResponse = (data: unknown): SetInstanceACLRulesResponse => { +export const unmarshalSetInstanceACLRulesResponse = ( + data: unknown, +): SetInstanceACLRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetInstanceACLRulesResponse' failed as data isn't a dictionary.`, @@ -782,7 +879,9 @@ export const unmarshalSetInstanceACLRulesResponse = (data: unknown): SetInstance } as SetInstanceACLRulesResponse } -export const unmarshalSetInstanceSettingsResponse = (data: unknown): SetInstanceSettingsResponse => { +export const unmarshalSetInstanceSettingsResponse = ( + data: unknown, +): SetInstanceSettingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetInstanceSettingsResponse' failed as data isn't a dictionary.`, @@ -806,7 +905,7 @@ export const marshalAddInstanceACLRulesRequest = ( request: AddInstanceACLRulesRequest, defaults: DefaultValues, ): Record => ({ - rules: request.rules.map(elt => marshalACLRuleRequest(elt, defaults)), + rules: request.rules.map(elt => marshalACLRuleRequest(elt, defaults)), }) const marshalInstanceSetting = ( @@ -821,7 +920,7 @@ export const marshalAddInstanceSettingsRequest = ( request: AddInstanceSettingsRequest, defaults: DefaultValues, ): Record => ({ - settings: request.settings.map(elt => marshalInstanceSetting(elt, defaults)), + settings: request.settings.map(elt => marshalInstanceSetting(elt, defaults)), }) export const marshalCloneInstanceRequest = ( @@ -852,27 +951,29 @@ export const marshalCreateDatabaseRequest = ( const marshalEndpointSpecPrivateNetworkIpamConfig = ( request: EndpointSpecPrivateNetworkIpamConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpecLoadBalancer = ( request: EndpointSpecLoadBalancer, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpecPrivateNetwork = ( request: EndpointSpecPrivateNetwork, defaults: DefaultValues, ): Record => ({ - private_network_id: request.privateNetworkId, + private_network_id: request.privateNetworkId, ...resolveOneOf>([ - {param: 'service_ip', - value: request.serviceIp, - }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig, defaults) - : undefined, + { param: 'service_ip', value: request.serviceIp }, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig, + defaults, + ) + : undefined, }, ]), }) @@ -880,15 +981,21 @@ const marshalEndpointSpecPrivateNetwork = ( const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'load_balancer', - value: (request.loadBalancer !== undefined) ? marshalEndpointSpecLoadBalancer(request.loadBalancer, defaults) - : undefined, + { + param: 'load_balancer', + value: + request.loadBalancer !== undefined + ? marshalEndpointSpecLoadBalancer(request.loadBalancer, defaults) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetwork(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetwork(request.privateNetwork, defaults) + : undefined, }, ]), }) @@ -897,7 +1004,10 @@ export const marshalCreateEndpointRequest = ( request: CreateEndpointRequest, defaults: DefaultValues, ): Record => ({ - endpoint_spec: ((request.endpointSpec !== undefined) ? marshalEndpointSpec(request.endpointSpec, defaults): undefined), + endpoint_spec: + request.endpointSpec !== undefined + ? marshalEndpointSpec(request.endpointSpec, defaults) + : undefined, }) export const marshalCreateInstanceFromSnapshotRequest = ( @@ -922,10 +1032,19 @@ export const marshalCreateInstanceRequest = ( ): Record => ({ backup_same_region: request.backupSameRegion, disable_backup: request.disableBackup, - encryption: ((request.encryption !== undefined) ? marshalEncryptionAtRest(request.encryption, defaults): undefined), + encryption: + request.encryption !== undefined + ? marshalEncryptionAtRest(request.encryption, defaults) + : undefined, engine: request.engine, - init_endpoints: ((request.initEndpoints !== undefined) ? request.initEndpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), - init_settings: ((request.initSettings !== undefined) ? request.initSettings.map(elt => marshalInstanceSetting(elt, defaults)): undefined), + init_endpoints: + request.initEndpoints !== undefined + ? request.initEndpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, + init_settings: + request.initSettings !== undefined + ? request.initSettings.map(elt => marshalInstanceSetting(elt, defaults)) + : undefined, is_ha_cluster: request.isHaCluster, name: request.name || randomName('ins'), node_type: request.nodeType, @@ -933,12 +1052,16 @@ export const marshalCreateInstanceRequest = ( tags: request.tags, user_name: request.userName, volume_size: request.volumeSize, - volume_type: request.volumeType, + volume_type: request.volumeType, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), @@ -947,27 +1070,29 @@ export const marshalCreateInstanceRequest = ( const marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig = ( request: ReadReplicaEndpointSpecPrivateNetworkIpamConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalReadReplicaEndpointSpecDirectAccess = ( request: ReadReplicaEndpointSpecDirectAccess, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalReadReplicaEndpointSpecPrivateNetwork = ( request: ReadReplicaEndpointSpecPrivateNetwork, defaults: DefaultValues, ): Record => ({ - private_network_id: request.privateNetworkId, + private_network_id: request.privateNetworkId, ...resolveOneOf>([ - {param: 'service_ip', - value: request.serviceIp, - }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig(request.ipamConfig, defaults) - : undefined, + { param: 'service_ip', value: request.serviceIp }, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalReadReplicaEndpointSpecPrivateNetworkIpamConfig( + request.ipamConfig, + defaults, + ) + : undefined, }, ]), }) @@ -975,15 +1100,27 @@ const marshalReadReplicaEndpointSpecPrivateNetwork = ( const marshalReadReplicaEndpointSpec = ( request: ReadReplicaEndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'direct_access', - value: (request.directAccess !== undefined) ? marshalReadReplicaEndpointSpecDirectAccess(request.directAccess, defaults) - : undefined, + { + param: 'direct_access', + value: + request.directAccess !== undefined + ? marshalReadReplicaEndpointSpecDirectAccess( + request.directAccess, + defaults, + ) + : undefined, }, - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalReadReplicaEndpointSpecPrivateNetwork(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalReadReplicaEndpointSpecPrivateNetwork( + request.privateNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -992,14 +1129,21 @@ export const marshalCreateReadReplicaEndpointRequest = ( request: CreateReadReplicaEndpointRequest, defaults: DefaultValues, ): Record => ({ - endpoint_spec: request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt, defaults)), + endpoint_spec: request.endpointSpec.map(elt => + marshalReadReplicaEndpointSpec(elt, defaults), + ), }) export const marshalCreateReadReplicaRequest = ( request: CreateReadReplicaRequest, defaults: DefaultValues, ): Record => ({ - endpoint_spec: ((request.endpointSpec !== undefined) ? request.endpointSpec.map(elt => marshalReadReplicaEndpointSpec(elt, defaults)): undefined), + endpoint_spec: + request.endpointSpec !== undefined + ? request.endpointSpec.map(elt => + marshalReadReplicaEndpointSpec(elt, defaults), + ) + : undefined, instance_id: request.instanceId, same_zone: request.sameZone, }) @@ -1069,14 +1213,14 @@ export const marshalSetInstanceACLRulesRequest = ( request: SetInstanceACLRulesRequest, defaults: DefaultValues, ): Record => ({ - rules: request.rules.map(elt => marshalACLRuleRequest(elt, defaults)), + rules: request.rules.map(elt => marshalACLRuleRequest(elt, defaults)), }) export const marshalSetInstanceSettingsRequest = ( request: SetInstanceSettingsRequest, defaults: DefaultValues, ): Record => ({ - settings: request.settings.map(elt => marshalInstanceSetting(elt, defaults)), + settings: request.settings.map(elt => marshalInstanceSetting(elt, defaults)), }) export const marshalSetPrivilegeRequest = ( @@ -1113,7 +1257,10 @@ export const marshalUpdateInstanceRequest = ( backup_schedule_retention: request.backupScheduleRetention, backup_schedule_start_hour: request.backupScheduleStartHour, is_backup_schedule_disabled: request.isBackupScheduleDisabled, - logs_policy: ((request.logsPolicy !== undefined) ? marshalLogsPolicy(request.logsPolicy, defaults): undefined), + logs_policy: + request.logsPolicy !== undefined + ? marshalLogsPolicy(request.logsPolicy, defaults) + : undefined, name: request.name, tags: request.tags, }) @@ -1145,29 +1292,23 @@ const marshalUpgradeInstanceRequestMajorUpgradeWorkflow = ( export const marshalUpgradeInstanceRequest = ( request: UpgradeInstanceRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf>([ - {param: 'node_type', - value: request.nodeType, - }, - {param: 'enable_ha', - value: request.enableHa, - }, - {param: 'volume_size', - value: request.volumeSize, - }, - {param: 'volume_type', - value: request.volumeType, - }, - {param: 'upgradable_version_id', - value: request.upgradableVersionId, - }, - {param: 'major_upgrade_workflow', - value: (request.majorUpgradeWorkflow !== undefined) ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow(request.majorUpgradeWorkflow, defaults) - : undefined, - }, - {param: 'enable_encryption', - value: request.enableEncryption, + { param: 'node_type', value: request.nodeType }, + { param: 'enable_ha', value: request.enableHa }, + { param: 'volume_size', value: request.volumeSize }, + { param: 'volume_type', value: request.volumeType }, + { param: 'upgradable_version_id', value: request.upgradableVersionId }, + { + param: 'major_upgrade_workflow', + value: + request.majorUpgradeWorkflow !== undefined + ? marshalUpgradeInstanceRequestMajorUpgradeWorkflow( + request.majorUpgradeWorkflow, + defaults, + ) + : undefined, }, + { param: 'enable_encryption', value: request.enableEncryption }, ]), }) diff --git a/packages_generated/rdb/src/v1/types.gen.ts b/packages_generated/rdb/src/v1/types.gen.ts index 68e35fc89..42fab21df 100644 --- a/packages_generated/rdb/src/v1/types.gen.ts +++ b/packages_generated/rdb/src/v1/types.gen.ts @@ -1,20 +1,16 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, TimeSeries, Zone as ScwZone} from '@scaleway/sdk-client' +import type { + Region as ScwRegion, + TimeSeries, + Zone as ScwZone, +} from '@scaleway/sdk-client' +export type ACLRuleAction = 'allow' | 'deny' -export type ACLRuleAction = - | 'allow' - | 'deny' +export type ACLRuleDirection = 'inbound' | 'outbound' -export type ACLRuleDirection = - | 'inbound' - | 'outbound' - -export type ACLRuleProtocol = - | 'tcp' - | 'udp' - | 'icmp' +export type ACLRuleProtocol = 'tcp' | 'udp' | 'icmp' export type DatabaseBackupStatus = | 'unknown' @@ -26,21 +22,11 @@ export type DatabaseBackupStatus = | 'exporting' | 'locked' -export type EndpointPrivateNetworkDetailsProvisioningMode = - | 'static' - | 'ipam' +export type EndpointPrivateNetworkDetailsProvisioningMode = 'static' | 'ipam' -export type EngineSettingPropertyType = - | 'BOOLEAN' - | 'INT' - | 'STRING' - | 'FLOAT' +export type EngineSettingPropertyType = 'BOOLEAN' | 'INT' | 'STRING' | 'FLOAT' -export type InstanceLogStatus = - | 'unknown' - | 'ready' - | 'creating' - | 'error' +export type InstanceLogStatus = 'unknown' | 'ready' | 'creating' | 'error' export type InstanceStatus = | 'unknown' @@ -122,12 +108,7 @@ export type NodeTypeStock = | 'out_of_stock' | 'available' -export type Permission = - | 'readonly' - | 'readwrite' - | 'all' - | 'custom' - | 'none' +export type Permission = 'readonly' | 'readwrite' | 'all' | 'custom' | 'none' export type ReadReplicaStatus = | 'unknown' @@ -149,25 +130,13 @@ export type SnapshotStatus = | 'error' | 'locked' -export type StorageClass = - | 'unknown_storage_class' - | 'lssd' - | 'bssd' - | 'sbs' - -export type VolumeType = - | 'lssd' - | 'bssd' - | 'sbs_5k' - | 'sbs_15k' - -export interface EndpointDirectAccessDetails { -} +export type StorageClass = 'unknown_storage_class' | 'lssd' | 'bssd' | 'sbs' +export type VolumeType = 'lssd' | 'bssd' | 'sbs_5k' | 'sbs_15k' -export interface EndpointLoadBalancerDetails { -} +export interface EndpointDirectAccessDetails {} +export interface EndpointLoadBalancerDetails {} export interface EndpointPrivateNetworkDetails { /** @@ -188,14 +157,9 @@ export interface EndpointPrivateNetworkDetails { provisioningMode: EndpointPrivateNetworkDetailsProvisioningMode } +export interface EndpointSpecPrivateNetworkIpamConfig {} -export interface EndpointSpecPrivateNetworkIpamConfig { -} - - -export interface ReadReplicaEndpointSpecPrivateNetworkIpamConfig { -} - +export interface ReadReplicaEndpointSpecPrivateNetworkIpamConfig {} export interface EngineSetting { /** @@ -244,7 +208,6 @@ export interface EngineSetting { floatMax?: number } - export interface Endpoint { /** * UUID of the endpoint. @@ -290,10 +253,7 @@ export interface Endpoint { hostname?: string } - -export interface EndpointSpecLoadBalancer { -} - +export interface EndpointSpecLoadBalancer {} export interface EndpointSpecPrivateNetwork { /** @@ -314,10 +274,7 @@ export interface EndpointSpecPrivateNetwork { ipamConfig?: EndpointSpecPrivateNetworkIpamConfig } - -export interface ReadReplicaEndpointSpecDirectAccess { -} - +export interface ReadReplicaEndpointSpecDirectAccess {} export interface ReadReplicaEndpointSpecPrivateNetwork { /** @@ -338,7 +295,6 @@ export interface ReadReplicaEndpointSpecPrivateNetwork { ipamConfig?: ReadReplicaEndpointSpecPrivateNetworkIpamConfig } - export interface EngineVersion { /** * Database engine version. @@ -370,7 +326,6 @@ export interface EngineVersion { availableInitSettings: EngineSetting[] } - export interface BackupSchedule { /** * Frequency of the backup schedule (in hours). @@ -390,18 +345,15 @@ export interface BackupSchedule { nextRunAt?: Date } - export interface EncryptionAtRest { enabled: boolean } - export interface InstanceSetting { name: string value: string } - export interface LogsPolicy { /** * Max age (in days) of remote logs to keep on the Database Instance. @@ -413,7 +365,6 @@ export interface LogsPolicy { totalDiskRetention?: number } - export interface Maintenance { /** * Start date of the maintenance window. @@ -445,7 +396,6 @@ export interface Maintenance { isApplicable: boolean } - export interface ReadReplica { /** * UUID of the Read Replica. @@ -473,7 +423,6 @@ export interface ReadReplica { instanceId: string } - export interface UpgradableVersion { id: string name: string @@ -481,14 +430,12 @@ export interface UpgradableVersion { minorVersion: string } - export interface Volume { type: VolumeType size: number class: StorageClass } - export interface NodeTypeVolumeConstraintSizes { /** * [deprecated] Minimum size required for the Volume. @@ -500,7 +447,6 @@ export interface NodeTypeVolumeConstraintSizes { maxSize: number } - export interface NodeTypeVolumeType { /** * Volume Type. @@ -528,23 +474,20 @@ export interface NodeTypeVolumeType { class: StorageClass } - export interface SnapshotVolumeType { type: VolumeType class: StorageClass } - export interface ACLRuleRequest { ip: string description: string } - export interface ACLRule { ip: string /** - * @deprecated + * @deprecated */ port?: number protocol: ACLRuleProtocol @@ -553,7 +496,6 @@ export interface ACLRule { description: string } - export interface EndpointSpec { /** * Load balancer endpoint specifications. Public endpoint for Database Instance which is systematically present. One per RDB instance. @@ -569,7 +511,6 @@ export interface EndpointSpec { privateNetwork?: EndpointSpecPrivateNetwork } - export interface ReadReplicaEndpointSpec { /** * Direct access endpoint specifications. Public endpoint reserved for Read Replicas. One per Read Replica. @@ -585,7 +526,6 @@ export interface ReadReplicaEndpointSpec { privateNetwork?: ReadReplicaEndpointSpecPrivateNetwork } - export interface DatabaseBackup { /** * UUID of the database backup. @@ -645,7 +585,6 @@ export interface DatabaseBackup { sameRegion: boolean } - export interface DatabaseEngine { /** * Engine name. @@ -665,7 +604,6 @@ export interface DatabaseEngine { region: ScwRegion } - export interface Database { /** * Name of the database. @@ -685,13 +623,11 @@ export interface Database { size: number } - export interface ListInstanceLogsDetailsResponseInstanceLogDetail { logName: string size: number } - export interface InstanceLog { /** * Presigned Object Storage URL to download your log file. @@ -723,7 +659,6 @@ export interface InstanceLog { region: ScwRegion } - export interface Instance { /** * Creation date (must follow the ISO 8601 format). @@ -819,7 +754,6 @@ export interface Instance { encryption?: EncryptionAtRest } - export interface NodeType { /** * Node Type name identifier. @@ -879,7 +813,6 @@ export interface NodeType { region: ScwRegion } - export interface Privilege { /** * Permission (Read, Read/Write, All, Custom). @@ -895,7 +828,6 @@ export interface Privilege { userName: string } - export interface Snapshot { /** * UUID of the snapshot. @@ -947,7 +879,6 @@ export interface Snapshot { region: ScwRegion } - export interface User { /** * Name of the user (Length must be between 1 and 63 characters for PostgreSQL and between 1 and 32 characters for MySQL. First character must be an alphabet character (a-zA-Z). Your username cannot start with '_rdb' or in PostgreSQL, 'pg_'. Only a-zA-Z0-9_$- characters are accepted). @@ -959,7 +890,6 @@ export interface User { isAdmin: boolean } - export interface UpgradeInstanceRequestMajorUpgradeWorkflow { /** * This will create a new Database Instance with same specifications as the current one and perform a Database Engine upgrade. @@ -971,7 +901,6 @@ export interface UpgradeInstanceRequestMajorUpgradeWorkflow { withEndpoints: boolean } - export type AddInstanceACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -987,7 +916,6 @@ export type AddInstanceACLRulesRequest = { rules: ACLRuleRequest[] } - export interface AddInstanceACLRulesResponse { /** * ACL Rules enabled for the Database Instance. @@ -995,7 +923,6 @@ export interface AddInstanceACLRulesResponse { rules: ACLRule[] } - export type AddInstanceSettingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1011,7 +938,6 @@ export type AddInstanceSettingsRequest = { settings: InstanceSetting[] } - export interface AddInstanceSettingsResponse { /** * Settings available on the Database Instance. @@ -1019,7 +945,6 @@ export interface AddInstanceSettingsResponse { settings: InstanceSetting[] } - export type ApplyInstanceMaintenanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1031,7 +956,6 @@ export type ApplyInstanceMaintenanceRequest = { instanceId: string } - export type CloneInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1051,7 +975,6 @@ export type CloneInstanceRequest = { nodeType?: string } - export type CreateDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1075,7 +998,6 @@ export type CreateDatabaseBackupRequest = { expiresAt?: Date } - export type CreateDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1091,7 +1013,6 @@ export type CreateDatabaseRequest = { name: string } - export type CreateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1107,7 +1028,6 @@ export type CreateEndpointRequest = { endpointSpec?: EndpointSpec } - export type CreateInstanceFromSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1131,7 +1051,6 @@ export type CreateInstanceFromSnapshotRequest = { nodeType?: string } - export type CreateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1207,7 +1126,6 @@ export type CreateInstanceRequest = { encryption?: EncryptionAtRest } - export type CreateReadReplicaEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1223,7 +1141,6 @@ export type CreateReadReplicaEndpointRequest = { endpointSpec: ReadReplicaEndpointSpec[] } - export type CreateReadReplicaRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1243,7 +1160,6 @@ export type CreateReadReplicaRequest = { sameZone?: boolean } - export type CreateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1263,7 +1179,6 @@ export type CreateSnapshotRequest = { expiresAt?: Date } - export type CreateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1287,7 +1202,6 @@ export type CreateUserRequest = { isAdmin: boolean } - export type DeleteDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1299,7 +1213,6 @@ export type DeleteDatabaseBackupRequest = { databaseBackupId: string } - export type DeleteDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1315,7 +1228,6 @@ export type DeleteDatabaseRequest = { name: string } - export type DeleteEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1327,7 +1239,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type DeleteInstanceACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1343,7 +1254,6 @@ export type DeleteInstanceACLRulesRequest = { aclRuleIps: string[] } - export interface DeleteInstanceACLRulesResponse { /** * IP addresses defined in the ACL rules of the Database Instance. @@ -1351,7 +1261,6 @@ export interface DeleteInstanceACLRulesResponse { rules: ACLRule[] } - export type DeleteInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1363,7 +1272,6 @@ export type DeleteInstanceRequest = { instanceId: string } - export type DeleteInstanceSettingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1379,7 +1287,6 @@ export type DeleteInstanceSettingsRequest = { settingNames: string[] } - export interface DeleteInstanceSettingsResponse { /** * Settings names to delete from the Database Instance. @@ -1387,7 +1294,6 @@ export interface DeleteInstanceSettingsResponse { settings: InstanceSetting[] } - export type DeleteReadReplicaRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1399,7 +1305,6 @@ export type DeleteReadReplicaRequest = { readReplicaId: string } - export type DeleteSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1411,7 +1316,6 @@ export type DeleteSnapshotRequest = { snapshotId: string } - export type DeleteUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1427,7 +1331,6 @@ export type DeleteUserRequest = { name: string } - export type ExportDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1439,7 +1342,6 @@ export type ExportDatabaseBackupRequest = { databaseBackupId: string } - export type GetDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1451,7 +1353,6 @@ export type GetDatabaseBackupRequest = { databaseBackupId: string } - export type GetEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1463,7 +1364,6 @@ export type GetEndpointRequest = { endpointId: string } - export type GetInstanceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1475,7 +1375,6 @@ export type GetInstanceCertificateRequest = { instanceId: string } - export type GetInstanceLogRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1487,7 +1386,6 @@ export type GetInstanceLogRequest = { instanceLogId: string } - export type GetInstanceMetricsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1511,7 +1409,6 @@ export type GetInstanceMetricsRequest = { metricName?: string } - export type GetInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1523,7 +1420,6 @@ export type GetInstanceRequest = { instanceId: string } - export type GetReadReplicaRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1535,7 +1431,6 @@ export type GetReadReplicaRequest = { readReplicaId: string } - export type GetSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1547,7 +1442,6 @@ export type GetSnapshotRequest = { snapshotId: string } - export interface InstanceMetrics { /** * Time series of metrics of a Database Instance. @@ -1555,7 +1449,6 @@ export interface InstanceMetrics { timeseries: TimeSeries[] } - export type ListDatabaseBackupsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1585,7 +1478,6 @@ export type ListDatabaseBackupsRequest = { pageSize?: number } - export interface ListDatabaseBackupsResponse { /** * List of database backups. @@ -1597,7 +1489,6 @@ export interface ListDatabaseBackupsResponse { totalCount: number } - export type ListDatabaseEnginesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1615,7 +1506,6 @@ export type ListDatabaseEnginesRequest = { pageSize?: number } - export interface ListDatabaseEnginesResponse { /** * List of the available database engines. @@ -1627,7 +1517,6 @@ export interface ListDatabaseEnginesResponse { totalCount: number } - export type ListDatabasesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1661,7 +1550,6 @@ export type ListDatabasesRequest = { pageSize?: number } - export interface ListDatabasesResponse { /** * List of the databases. @@ -1673,7 +1561,6 @@ export interface ListDatabasesResponse { totalCount: number } - export type ListInstanceACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1687,7 +1574,6 @@ export type ListInstanceACLRulesRequest = { pageSize?: number } - export interface ListInstanceACLRulesResponse { /** * List of ACL rules present on a Database Instance. @@ -1699,7 +1585,6 @@ export interface ListInstanceACLRulesResponse { totalCount: number } - export type ListInstanceLogsDetailsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1711,7 +1596,6 @@ export type ListInstanceLogsDetailsRequest = { instanceId: string } - export interface ListInstanceLogsDetailsResponse { /** * Remote Database Instance logs details. @@ -1719,7 +1603,6 @@ export interface ListInstanceLogsDetailsResponse { details: ListInstanceLogsDetailsResponseInstanceLogDetail[] } - export type ListInstanceLogsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1735,7 +1618,6 @@ export type ListInstanceLogsRequest = { orderBy?: ListInstanceLogsRequestOrderBy } - export interface ListInstanceLogsResponse { /** * Available logs in a Database Instance. @@ -1743,7 +1625,6 @@ export interface ListInstanceLogsResponse { instanceLogs: InstanceLog[] } - export type ListInstancesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1777,7 +1658,6 @@ export type ListInstancesRequest = { pageSize?: number } - export interface ListInstancesResponse { /** * List of all Database Instances available in an Organization or Project. @@ -1789,7 +1669,6 @@ export interface ListInstancesResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1803,7 +1682,6 @@ export type ListNodeTypesRequest = { pageSize?: number } - export interface ListNodeTypesResponse { /** * Types of the node. @@ -1815,7 +1693,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type ListPrivilegesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1841,7 +1718,6 @@ export type ListPrivilegesRequest = { userName?: string } - export interface ListPrivilegesResponse { /** * Privileges of a user in a database in a Database Instance. @@ -1853,7 +1729,6 @@ export interface ListPrivilegesResponse { totalCount: number } - export type ListSnapshotsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1883,7 +1758,6 @@ export type ListSnapshotsRequest = { pageSize?: number } - export interface ListSnapshotsResponse { /** * List of snapshots. @@ -1895,7 +1769,6 @@ export interface ListSnapshotsResponse { totalCount: number } - export type ListUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1917,7 +1790,6 @@ export type ListUsersRequest = { pageSize?: number } - export interface ListUsersResponse { /** * List of users in a Database Instance. @@ -1929,7 +1801,6 @@ export interface ListUsersResponse { totalCount: number } - export type MigrateEndpointRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1945,7 +1816,6 @@ export type MigrateEndpointRequest = { instanceId: string } - export type PrepareInstanceLogsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1965,7 +1835,6 @@ export type PrepareInstanceLogsRequest = { endDate?: Date } - export interface PrepareInstanceLogsResponse { /** * Instance logs for a Database Instance between a start and an end date. @@ -1973,7 +1842,6 @@ export interface PrepareInstanceLogsResponse { instanceLogs: InstanceLog[] } - export type PromoteReadReplicaRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1985,7 +1853,6 @@ export type PromoteReadReplicaRequest = { readReplicaId: string } - export type PurgeInstanceLogsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2001,7 +1868,6 @@ export type PurgeInstanceLogsRequest = { logName?: string } - export type RenewInstanceCertificateRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2013,7 +1879,6 @@ export type RenewInstanceCertificateRequest = { instanceId: string } - export type ResetReadReplicaRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2025,7 +1890,6 @@ export type ResetReadReplicaRequest = { readReplicaId: string } - export type RestartInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2037,7 +1901,6 @@ export type RestartInstanceRequest = { instanceId: string } - export type RestoreDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2057,7 +1920,6 @@ export type RestoreDatabaseBackupRequest = { instanceId: string } - export type SetInstanceACLRulesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2073,7 +1935,6 @@ export type SetInstanceACLRulesRequest = { rules: ACLRuleRequest[] } - export interface SetInstanceACLRulesResponse { /** * ACLs rules configured for a Database Instance. @@ -2081,7 +1942,6 @@ export interface SetInstanceACLRulesResponse { rules: ACLRule[] } - export type SetInstanceSettingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2097,7 +1957,6 @@ export type SetInstanceSettingsRequest = { settings: InstanceSetting[] } - export interface SetInstanceSettingsResponse { /** * Settings configured for a Database Instance. @@ -2105,7 +1964,6 @@ export interface SetInstanceSettingsResponse { settings: InstanceSetting[] } - export type SetPrivilegeRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2129,7 +1987,6 @@ export type SetPrivilegeRequest = { permission?: Permission } - export type UpdateDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2149,7 +2006,6 @@ export type UpdateDatabaseBackupRequest = { expiresAt?: Date } - export type UpdateInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2193,7 +2049,6 @@ export type UpdateInstanceRequest = { backupScheduleStartHour?: number } - export type UpdateSnapshotRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2213,7 +2068,6 @@ export type UpdateSnapshotRequest = { expiresAt?: Date } - export type UpdateUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2237,7 +2091,6 @@ export type UpdateUserRequest = { isAdmin?: boolean } - export type UpgradeInstanceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2290,5 +2143,3 @@ export type UpgradeInstanceRequest = { */ enableEncryption?: boolean } - - diff --git a/packages_generated/redis/src/v1/api.gen.ts b/packages_generated/redis/src/v1/api.gen.ts index 88227a61b..893b9930f 100644 --- a/packages_generated/redis/src/v1/api.gen.ts +++ b/packages_generated/redis/src/v1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_REDIS,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { CLUSTER_TRANSIENT_STATUSES as CLUSTER_TRANSIENT_STATUSES_REDIS } from './content.gen.js' import { unmarshalACLRule, marshalAddAclRulesRequest, @@ -86,18 +86,17 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'pl-waw-1', - 'pl-waw-2', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'pl-waw-1', + 'pl-waw-2', + ], + }) + /** * Create a Redis™ Database Instance. Create a new Redis™ Database Instance (Redis™ cluster). You must set the `zone`, `project_id`, `version`, `node_type`, `user_name` and `password` parameters. Optionally you can define `acl_rules`, `endpoints`, `tls_enabled` and `cluster_settings`. * @@ -117,7 +116,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Update a Redis™ Database Instance. Update the parameters of a Redis™ Database Instance (Redis™ cluster), including `name`, `tags`, `user_name` and `password`. * @@ -137,7 +135,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get a Redis™ Database Instance. Retrieve information about a Redis™ Database Instance (Redis™ cluster). Specify the `cluster_id` and `region` in your request to get information such as `id`, `status`, `version`, `tls_enabled`, `cluster_settings`, `upgradable_versions` and `endpoints` about your cluster in the response. * @@ -152,7 +149,7 @@ export class API extends ParentAPI { }, unmarshalCluster, ) - + /** * Waits for {@link Cluster} to be in a final state. * @@ -165,14 +162,19 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!CLUSTER_TRANSIENT_STATUSES_REDIS.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !CLUSTER_TRANSIENT_STATUSES_REDIS.includes(res.status), + )), this.getCluster, request, options, ) - - protected pageOfListClusters = (request: Readonly = {}) => + protected pageOfListClusters = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -182,7 +184,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ['version', request.version], @@ -190,7 +195,7 @@ export class API extends ParentAPI { }, unmarshalListClustersResponse, ) - + /** * List Redis™ Database Instances. List all Redis™ Database Instances (Redis™ cluster) in the specified zone. By default, the Database Instances returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. You can define additional parameters for your query, such as `tags`, `name`, `organization_id` and `version`. * @@ -200,7 +205,6 @@ export class API extends ParentAPI { listClusters = (request: Readonly = {}) => enrichForPagination('clusters', this.pageOfListClusters, request) - /** * Scale up a Redis™ Database Instance. Upgrade your Redis™ Database Instance, either by upgrading to a bigger node type (vertical scaling) or by adding more nodes to your Database Instance to increase your number of endpoints and distribute cache (horizontal scaling, available for clusters only). Note that scaling horizontally your Redis™ Database Instance will not renew its TLS certificate. In order to refresh the TLS certificate, you must use the Renew TLS certificate endpoint. * @@ -220,7 +224,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Delete a Redis™ Database Instance. Delete a Redis™ Database Instance (Redis™ cluster), specified by the `region` and `cluster_id` parameters. Deleting a Database Instance is permanent, and cannot be undone. Note that upon deletion all your data will be lost. * @@ -236,7 +239,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get metrics of a Redis™ Database Instance. Retrieve the metrics of a Redis™ Database Instance (Redis™ cluster). You can define the period from which to retrieve metrics by specifying the `start_date` and `end_date`. * @@ -257,7 +259,6 @@ export class API extends ParentAPI { unmarshalClusterMetricsResponse, ) - protected pageOfListNodeTypes = (request: Readonly) => this.client.fetch( { @@ -266,12 +267,15 @@ export class API extends ParentAPI { urlParams: urlParams( ['include_disabled_types', request.includeDisabledTypes], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListNodeTypesResponse, ) - + /** * List available node types. List all available node types. By default, the node types returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field. * @@ -281,8 +285,9 @@ export class API extends ParentAPI { listNodeTypes = (request: Readonly) => enrichForPagination('nodeTypes', this.pageOfListNodeTypes, request) - - protected pageOfListClusterVersions = (request: Readonly) => + protected pageOfListClusterVersions = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -292,13 +297,16 @@ export class API extends ParentAPI { ['include_deprecated', request.includeDeprecated], ['include_disabled', request.includeDisabled], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['version', request.version], ), }, unmarshalListClusterVersionsResponse, ) - + /** * List available Redis™ versions. List the Redis™ database engine versions available. You can define additional parameters for your query, such as `include_disabled`, `include_beta`, `include_deprecated` and `version`. * @@ -308,7 +316,6 @@ export class API extends ParentAPI { listClusterVersions = (request: Readonly) => enrichForPagination('versions', this.pageOfListClusterVersions, request) - /** * Get the TLS certificate of a cluster. Retrieve information about the TLS certificate of a Redis™ Database Instance (Redis™ cluster). Details like name and content are returned in the response. * @@ -316,25 +323,22 @@ export class API extends ParentAPI { * @returns A Promise of Blob */ getClusterCertificate = (request: Readonly) => - this.client.fetch( - { - method: 'GET', - path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate`, - urlParams: urlParams( - ['dl', 1], - ), - responseType: 'blob', - }, - ) + this.client.fetch({ + method: 'GET', + path: `/redis/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/clusters/${validatePathParam('clusterId', request.clusterId)}/certificate`, + urlParams: urlParams(['dl', 1]), + responseType: 'blob', + }) - /** * Renew the TLS certificate of a cluster. Renew a TLS certificate for a Redis™ Database Instance (Redis™ cluster). Renewing a certificate means that you will not be able to connect to your Database Instance using the previous certificate. You will also need to download and update the new certificate for all database clients. * * @param request - The request {@link RenewClusterCertificateRequest} * @returns A Promise of Cluster */ - renewClusterCertificate = (request: Readonly) => + renewClusterCertificate = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -345,7 +349,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Add advanced settings. Add an advanced setting to a Redis™ Database Instance (Redis™ cluster). You must set the `name` and the `value` of each setting. * @@ -365,7 +368,6 @@ export class API extends ParentAPI { unmarshalClusterSettingsResponse, ) - /** * Delete advanced setting. Delete an advanced setting in a Redis™ Database Instance (Redis™ cluster). You must specify the names of the settings you want to delete in the request body. * @@ -381,7 +383,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Set advanced settings. Update an advanced setting for a Redis™ Database Instance (Redis™ cluster). Settings added upon database engine initialization can only be defined once, and cannot, therefore, be updated. * @@ -401,7 +402,6 @@ export class API extends ParentAPI { unmarshalClusterSettingsResponse, ) - /** * Set ACL rules for a cluster. Replace all the ACL rules of a Redis™ Database Instance (Redis™ cluster). * @@ -421,7 +421,6 @@ export class API extends ParentAPI { unmarshalSetAclRulesResponse, ) - /** * Add ACL rules for a cluster. Add an additional ACL rule to a Redis™ Database Instance (Redis™ cluster). * @@ -441,7 +440,6 @@ export class API extends ParentAPI { unmarshalAddAclRulesResponse, ) - /** * Delete an ACL rule for a cluster. Delete an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule you want to delete in your request. * @@ -457,7 +455,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get an ACL rule. Retrieve information about an ACL rule of a Redis™ Database Instance (Redis™ cluster). You must specify the `acl_id` of the rule in your request. * @@ -473,7 +470,6 @@ export class API extends ParentAPI { unmarshalACLRule, ) - /** * Set endpoints for a cluster. Update an endpoint for a Redis™ Database Instance (Redis™ cluster). You must specify the `cluster_id` and the `endpoints` parameters in your request. * @@ -493,7 +489,6 @@ export class API extends ParentAPI { unmarshalSetEndpointsResponse, ) - /** * Add endpoints for a cluster. Add a new endpoint for a Redis™ Database Instance (Redis™ cluster). You can add `private_network` or `public_network` specifications to the body of the request. * @@ -513,7 +508,6 @@ export class API extends ParentAPI { unmarshalAddEndpointsResponse, ) - /** * Delete an endpoint for a cluster. Delete the endpoint of a Redis™ Database Instance (Redis™ cluster). You must specify the `region` and `endpoint_id` parameters of the endpoint you want to delete. Note that might need to update any environment configurations that point to the deleted endpoint. * @@ -529,7 +523,6 @@ export class API extends ParentAPI { unmarshalCluster, ) - /** * Get an endpoint. Retrieve information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response. * @@ -545,7 +538,6 @@ export class API extends ParentAPI { unmarshalEndpoint, ) - /** * Update an endpoint. Update information about a Redis™ Database Instance (Redis™ cluster) endpoint. Full details about the endpoint, like `ips`, `port`, `private_network` and `public_network` specifications are returned in the response. * @@ -564,7 +556,4 @@ export class API extends ParentAPI { }, unmarshalEndpoint, ) - - } - diff --git a/packages_generated/redis/src/v1/content.gen.ts b/packages_generated/redis/src/v1/content.gen.ts index 725d5a722..82f6d2ab6 100644 --- a/packages_generated/redis/src/v1/content.gen.ts +++ b/packages_generated/redis/src/v1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - ClusterStatus, -} from './types.gen.js' - +import type { ClusterStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link ClusterStatus}. */ export const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[] = [ @@ -13,4 +10,3 @@ export const CLUSTER_TRANSIENT_STATUSES: ClusterStatus[] = [ 'autohealing', 'initializing', ] - diff --git a/packages_generated/redis/src/v1/index.gen.ts b/packages_generated/redis/src/v1/index.gen.ts index 5bc9d78d2..9c75798a6 100644 --- a/packages_generated/redis/src/v1/index.gen.ts +++ b/packages_generated/redis/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/redis/src/v1/marshalling.gen.ts b/packages_generated/redis/src/v1/marshalling.gen.ts index bc05f97e6..4a1983543 100644 --- a/packages_generated/redis/src/v1/marshalling.gen.ts +++ b/packages_generated/redis/src/v1/marshalling.gen.ts @@ -1,7 +1,13 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalTimeSeries, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalTimeSeries, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { ACLRule, @@ -75,8 +81,7 @@ const unmarshalPublicNetwork = (data: unknown): PublicNetwork => { ) } - return { - } as PublicNetwork + return {} as PublicNetwork } export const unmarshalEndpoint = (data: unknown): Endpoint => { @@ -90,8 +95,12 @@ export const unmarshalEndpoint = (data: unknown): Endpoint => { id: data.id, ips: data.ips, port: data.port, - privateNetwork: data.private_network ? unmarshalPrivateNetwork(data.private_network) : undefined, - publicNetwork: data.public_network ? unmarshalPublicNetwork(data.public_network) : undefined, + privateNetwork: data.private_network + ? unmarshalPrivateNetwork(data.private_network) + : undefined, + publicNetwork: data.public_network + ? unmarshalPublicNetwork(data.public_network) + : undefined, } as Endpoint } @@ -117,7 +126,10 @@ export const unmarshalCluster = (data: unknown): Cluster => { return { aclRules: unmarshalArrayOfObject(data.acl_rules, unmarshalACLRule), - clusterSettings: unmarshalArrayOfObject(data.cluster_settings, unmarshalClusterSetting), + clusterSettings: unmarshalArrayOfObject( + data.cluster_settings, + unmarshalClusterSetting, + ), clusterSize: data.cluster_size, createdAt: unmarshalDate(data.created_at), endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint), @@ -136,7 +148,9 @@ export const unmarshalCluster = (data: unknown): Cluster => { } as Cluster } -export const unmarshalAddAclRulesResponse = (data: unknown): AddAclRulesResponse => { +export const unmarshalAddAclRulesResponse = ( + data: unknown, +): AddAclRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddAclRulesResponse' failed as data isn't a dictionary.`, @@ -149,7 +163,9 @@ export const unmarshalAddAclRulesResponse = (data: unknown): AddAclRulesResponse } as AddAclRulesResponse } -export const unmarshalAddEndpointsResponse = (data: unknown): AddEndpointsResponse => { +export const unmarshalAddEndpointsResponse = ( + data: unknown, +): AddEndpointsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddEndpointsResponse' failed as data isn't a dictionary.`, @@ -162,7 +178,9 @@ export const unmarshalAddEndpointsResponse = (data: unknown): AddEndpointsRespon } as AddEndpointsResponse } -export const unmarshalClusterMetricsResponse = (data: unknown): ClusterMetricsResponse => { +export const unmarshalClusterMetricsResponse = ( + data: unknown, +): ClusterMetricsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ClusterMetricsResponse' failed as data isn't a dictionary.`, @@ -174,7 +192,9 @@ export const unmarshalClusterMetricsResponse = (data: unknown): ClusterMetricsRe } as ClusterMetricsResponse } -export const unmarshalClusterSettingsResponse = (data: unknown): ClusterSettingsResponse => { +export const unmarshalClusterSettingsResponse = ( + data: unknown, +): ClusterSettingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ClusterSettingsResponse' failed as data isn't a dictionary.`, @@ -186,7 +206,9 @@ export const unmarshalClusterSettingsResponse = (data: unknown): ClusterSettings } as ClusterSettingsResponse } -const unmarshalAvailableClusterSetting = (data: unknown): AvailableClusterSetting => { +const unmarshalAvailableClusterSetting = ( + data: unknown, +): AvailableClusterSetting => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AvailableClusterSetting' failed as data isn't a dictionary.`, @@ -213,7 +235,10 @@ const unmarshalClusterVersion = (data: unknown): ClusterVersion => { } return { - availableSettings: unmarshalArrayOfObject(data.available_settings, unmarshalAvailableClusterSetting), + availableSettings: unmarshalArrayOfObject( + data.available_settings, + unmarshalAvailableClusterSetting, + ), endOfLifeAt: unmarshalDate(data.end_of_life_at), logoUrl: data.logo_url, version: data.version, @@ -221,7 +246,9 @@ const unmarshalClusterVersion = (data: unknown): ClusterVersion => { } as ClusterVersion } -export const unmarshalListClusterVersionsResponse = (data: unknown): ListClusterVersionsResponse => { +export const unmarshalListClusterVersionsResponse = ( + data: unknown, +): ListClusterVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClusterVersionsResponse' failed as data isn't a dictionary.`, @@ -234,7 +261,9 @@ export const unmarshalListClusterVersionsResponse = (data: unknown): ListCluster } as ListClusterVersionsResponse } -export const unmarshalListClustersResponse = (data: unknown): ListClustersResponse => { +export const unmarshalListClustersResponse = ( + data: unknown, +): ListClustersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListClustersResponse' failed as data isn't a dictionary.`, @@ -266,7 +295,9 @@ const unmarshalNodeType = (data: unknown): NodeType => { } as NodeType } -export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResponse => { +export const unmarshalListNodeTypesResponse = ( + data: unknown, +): ListNodeTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNodeTypesResponse' failed as data isn't a dictionary.`, @@ -279,7 +310,9 @@ export const unmarshalListNodeTypesResponse = (data: unknown): ListNodeTypesResp } as ListNodeTypesResponse } -export const unmarshalSetAclRulesResponse = (data: unknown): SetAclRulesResponse => { +export const unmarshalSetAclRulesResponse = ( + data: unknown, +): SetAclRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetAclRulesResponse' failed as data isn't a dictionary.`, @@ -291,7 +324,9 @@ export const unmarshalSetAclRulesResponse = (data: unknown): SetAclRulesResponse } as SetAclRulesResponse } -export const unmarshalSetEndpointsResponse = (data: unknown): SetEndpointsResponse => { +export const unmarshalSetEndpointsResponse = ( + data: unknown, +): SetEndpointsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetEndpointsResponse' failed as data isn't a dictionary.`, @@ -315,7 +350,7 @@ export const marshalAddAclRulesRequest = ( request: AddAclRulesRequest, defaults: DefaultValues, ): Record => ({ - acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)), + acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)), }) const marshalClusterSetting = ( @@ -330,42 +365,58 @@ export const marshalAddClusterSettingsRequest = ( request: AddClusterSettingsRequest, defaults: DefaultValues, ): Record => ({ - settings: request.settings.map(elt => marshalClusterSetting(elt, defaults)), + settings: request.settings.map(elt => marshalClusterSetting(elt, defaults)), }) const marshalEndpointSpecPrivateNetworkSpecIpamConfig = ( request: EndpointSpecPrivateNetworkSpecIpamConfig, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpecPrivateNetworkSpec = ( request: EndpointSpecPrivateNetworkSpec, defaults: DefaultValues, ): Record => ({ id: request.id, - ipam_config: ((request.ipamConfig !== undefined) ? marshalEndpointSpecPrivateNetworkSpecIpamConfig(request.ipamConfig, defaults): undefined), + ipam_config: + request.ipamConfig !== undefined + ? marshalEndpointSpecPrivateNetworkSpecIpamConfig( + request.ipamConfig, + defaults, + ) + : undefined, service_ips: request.serviceIps, }) const marshalEndpointSpecPublicNetworkSpec = ( request: EndpointSpecPublicNetworkSpec, defaults: DefaultValues, -): Record => ({ -}) +): Record => ({}) const marshalEndpointSpec = ( request: EndpointSpec, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkSpec( + request.privateNetwork, + defaults, + ) + : undefined, }, - {param: 'public_network', - value: (request.publicNetwork !== undefined) ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork, defaults) - : undefined, + { + param: 'public_network', + value: + request.publicNetwork !== undefined + ? marshalEndpointSpecPublicNetworkSpec( + request.publicNetwork, + defaults, + ) + : undefined, }, ]), }) @@ -374,17 +425,26 @@ export const marshalAddEndpointsRequest = ( request: AddEndpointsRequest, defaults: DefaultValues, ): Record => ({ - endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), + endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), }) export const marshalCreateClusterRequest = ( request: CreateClusterRequest, defaults: DefaultValues, ): Record => ({ - acl_rules: ((request.aclRules !== undefined) ? request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)): undefined), - cluster_settings: ((request.clusterSettings !== undefined) ? request.clusterSettings.map(elt => marshalClusterSetting(elt, defaults)): undefined), + acl_rules: + request.aclRules !== undefined + ? request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)) + : undefined, + cluster_settings: + request.clusterSettings !== undefined + ? request.clusterSettings.map(elt => marshalClusterSetting(elt, defaults)) + : undefined, cluster_size: request.clusterSize, - endpoints: ((request.endpoints !== undefined) ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)): undefined), + endpoints: + request.endpoints !== undefined + ? request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)) + : undefined, name: request.name || randomName('ins'), node_type: request.nodeType, password: request.password, @@ -398,17 +458,11 @@ export const marshalCreateClusterRequest = ( export const marshalMigrateClusterRequest = ( request: MigrateClusterRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'version', - value: request.version, - }, - {param: 'node_type', - value: request.nodeType, - }, - {param: 'cluster_size', - value: request.clusterSize, - }, + { param: 'version', value: request.version }, + { param: 'node_type', value: request.nodeType }, + { param: 'cluster_size', value: request.clusterSize }, ]), }) @@ -416,21 +470,21 @@ export const marshalSetAclRulesRequest = ( request: SetAclRulesRequest, defaults: DefaultValues, ): Record => ({ - acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)), + acl_rules: request.aclRules.map(elt => marshalACLRuleSpec(elt, defaults)), }) export const marshalSetClusterSettingsRequest = ( request: SetClusterSettingsRequest, defaults: DefaultValues, ): Record => ({ - settings: request.settings.map(elt => marshalClusterSetting(elt, defaults)), + settings: request.settings.map(elt => marshalClusterSetting(elt, defaults)), }) export const marshalSetEndpointsRequest = ( request: SetEndpointsRequest, defaults: DefaultValues, ): Record => ({ - endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), + endpoints: request.endpoints.map(elt => marshalEndpointSpec(elt, defaults)), }) export const marshalUpdateClusterRequest = ( @@ -446,15 +500,27 @@ export const marshalUpdateClusterRequest = ( export const marshalUpdateEndpointRequest = ( request: UpdateEndpointRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'private_network', - value: (request.privateNetwork !== undefined) ? marshalEndpointSpecPrivateNetworkSpec(request.privateNetwork, defaults) - : undefined, + { + param: 'private_network', + value: + request.privateNetwork !== undefined + ? marshalEndpointSpecPrivateNetworkSpec( + request.privateNetwork, + defaults, + ) + : undefined, }, - {param: 'public_network', - value: (request.publicNetwork !== undefined) ? marshalEndpointSpecPublicNetworkSpec(request.publicNetwork, defaults) - : undefined, + { + param: 'public_network', + value: + request.publicNetwork !== undefined + ? marshalEndpointSpecPublicNetworkSpec( + request.publicNetwork, + defaults, + ) + : undefined, }, ]), }) diff --git a/packages_generated/redis/src/v1/types.gen.ts b/packages_generated/redis/src/v1/types.gen.ts index 669a35ff9..cd73d8400 100644 --- a/packages_generated/redis/src/v1/types.gen.ts +++ b/packages_generated/redis/src/v1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { TimeSeries, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { TimeSeries, Zone as ScwZone } from '@scaleway/sdk-client' export type AvailableClusterSettingPropertyType = | 'UNKNOWN' @@ -33,13 +32,9 @@ export type NodeTypeStock = | 'out_of_stock' | 'available' -export type PrivateNetworkProvisioningMode = - | 'static' - | 'ipam' - -export interface EndpointSpecPrivateNetworkSpecIpamConfig { -} +export type PrivateNetworkProvisioningMode = 'static' | 'ipam' +export interface EndpointSpecPrivateNetworkSpecIpamConfig {} export interface PrivateNetwork { /** @@ -60,10 +55,7 @@ export interface PrivateNetwork { provisioningMode: PrivateNetworkProvisioningMode } - -export interface PublicNetwork { -} - +export interface PublicNetwork {} export interface EndpointSpecPrivateNetworkSpec { /** @@ -80,10 +72,7 @@ export interface EndpointSpecPrivateNetworkSpec { ipamConfig?: EndpointSpecPrivateNetworkSpecIpamConfig } - -export interface EndpointSpecPublicNetworkSpec { -} - +export interface EndpointSpecPublicNetworkSpec {} export interface AvailableClusterSetting { /** @@ -120,7 +109,6 @@ export interface AvailableClusterSetting { deprecated: boolean } - export interface ACLRule { /** * ID of the rule. @@ -136,7 +124,6 @@ export interface ACLRule { description?: string } - export interface ClusterSetting { /** * Value of the setting. @@ -148,7 +135,6 @@ export interface ClusterSetting { name: string } - export interface Endpoint { /** * TCP port of the endpoint. @@ -176,7 +162,6 @@ export interface Endpoint { id: string } - export interface ACLRuleSpec { /** * IPv4 network address of the rule. @@ -188,7 +173,6 @@ export interface ACLRuleSpec { description: string } - export interface EndpointSpec { /** * Private Network specification details. @@ -204,7 +188,6 @@ export interface EndpointSpec { publicNetwork?: EndpointSpecPublicNetworkSpec } - export interface ClusterVersion { /** * Redis™ engine version. @@ -228,7 +211,6 @@ export interface ClusterVersion { zone: ScwZone } - export interface Cluster { /** * UUID of the Database Instance. @@ -300,7 +282,6 @@ export interface Cluster { upgradableVersions: string[] } - export interface NodeType { /** * Node type name. @@ -336,7 +317,6 @@ export interface NodeType { zone: ScwZone } - export type AddAclRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -352,7 +332,6 @@ export type AddAclRulesRequest = { aclRules: ACLRuleSpec[] } - export interface AddAclRulesResponse { /** * ACL Rules enabled for the Database Instance. @@ -364,7 +343,6 @@ export interface AddAclRulesResponse { totalCount: number } - export type AddClusterSettingsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -380,7 +358,6 @@ export type AddClusterSettingsRequest = { settings: ClusterSetting[] } - export type AddEndpointsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -396,7 +373,6 @@ export type AddEndpointsRequest = { endpoints: EndpointSpec[] } - export interface AddEndpointsResponse { /** * Endpoints defined on the Database Instance. @@ -408,7 +384,6 @@ export interface AddEndpointsResponse { totalCount: number } - export interface ClusterMetricsResponse { /** * Time series of metrics of a given cluster. @@ -416,7 +391,6 @@ export interface ClusterMetricsResponse { timeseries: TimeSeries[] } - export interface ClusterSettingsResponse { /** * Settings configured for a given Database Instance. @@ -424,7 +398,6 @@ export interface ClusterSettingsResponse { settings: ClusterSetting[] } - export type CreateClusterRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -480,7 +453,6 @@ export type CreateClusterRequest = { clusterSettings?: ClusterSetting[] } - export type DeleteAclRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -492,7 +464,6 @@ export type DeleteAclRuleRequest = { aclId: string } - export type DeleteClusterRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -504,7 +475,6 @@ export type DeleteClusterRequest = { clusterId: string } - export type DeleteClusterSettingRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -520,7 +490,6 @@ export type DeleteClusterSettingRequest = { settingName: string } - export type DeleteEndpointRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -532,7 +501,6 @@ export type DeleteEndpointRequest = { endpointId: string } - export type GetAclRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -544,7 +512,6 @@ export type GetAclRuleRequest = { aclId: string } - export type GetClusterCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -556,7 +523,6 @@ export type GetClusterCertificateRequest = { clusterId: string } - export type GetClusterMetricsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -580,7 +546,6 @@ export type GetClusterMetricsRequest = { metricName?: string } - export type GetClusterRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -592,7 +557,6 @@ export type GetClusterRequest = { clusterId: string } - export type GetEndpointRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -604,7 +568,6 @@ export type GetEndpointRequest = { endpointId: string } - export type ListClusterVersionsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -630,7 +593,6 @@ export type ListClusterVersionsRequest = { pageSize?: number } - export interface ListClusterVersionsResponse { /** * List of available Redis™ engine versions. @@ -642,7 +604,6 @@ export interface ListClusterVersionsResponse { totalCount: number } - export type ListClustersRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -676,7 +637,6 @@ export type ListClustersRequest = { pageSize?: number } - export interface ListClustersResponse { /** * List all Database Instances. @@ -688,7 +648,6 @@ export interface ListClustersResponse { totalCount: number } - export type ListNodeTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -702,7 +661,6 @@ export type ListNodeTypesRequest = { pageSize?: number } - export interface ListNodeTypesResponse { /** * Types of node. @@ -714,7 +672,6 @@ export interface ListNodeTypesResponse { totalCount: number } - export type MigrateClusterRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -744,7 +701,6 @@ export type MigrateClusterRequest = { clusterSize?: number } - export type RenewClusterCertificateRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -756,7 +712,6 @@ export type RenewClusterCertificateRequest = { clusterId: string } - export type SetAclRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -772,7 +727,6 @@ export type SetAclRulesRequest = { aclRules: ACLRuleSpec[] } - export interface SetAclRulesResponse { /** * ACL Rules enabled for the Database Instance. @@ -780,7 +734,6 @@ export interface SetAclRulesResponse { aclRules: ACLRule[] } - export type SetClusterSettingsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -796,7 +749,6 @@ export type SetClusterSettingsRequest = { settings: ClusterSetting[] } - export type SetEndpointsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -812,7 +764,6 @@ export type SetEndpointsRequest = { endpoints: EndpointSpec[] } - export interface SetEndpointsResponse { /** * Endpoints defined on the Database Instance. @@ -820,7 +771,6 @@ export interface SetEndpointsResponse { endpoints: Endpoint[] } - export type UpdateClusterRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -848,7 +798,6 @@ export type UpdateClusterRequest = { password?: string } - export type UpdateEndpointRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -871,5 +820,3 @@ export type UpdateEndpointRequest = { */ publicNetwork?: EndpointSpecPublicNetworkSpec } - - diff --git a/packages_generated/registry/src/v1/api.gen.ts b/packages_generated/registry/src/v1/api.gen.ts index f08180a17..48e7f307f 100644 --- a/packages_generated/registry/src/v1/api.gen.ts +++ b/packages_generated/registry/src/v1/api.gen.ts @@ -8,8 +8,12 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {IMAGE_TRANSIENT_STATUSES as IMAGE_TRANSIENT_STATUSES_REGISTRY,NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_REGISTRY,TAG_TRANSIENT_STATUSES as TAG_TRANSIENT_STATUSES_REGISTRY,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + IMAGE_TRANSIENT_STATUSES as IMAGE_TRANSIENT_STATUSES_REGISTRY, + NAMESPACE_TRANSIENT_STATUSES as NAMESPACE_TRANSIENT_STATUSES_REGISTRY, + TAG_TRANSIENT_STATUSES as TAG_TRANSIENT_STATUSES_REGISTRY, +} from './content.gen.js' import { marshalCreateNamespaceRequest, unmarshalImage, @@ -56,16 +60,13 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListNamespaces = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListNamespaces = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -75,13 +76,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListNamespacesResponse, ) - + /** * List namespaces. List all namespaces in a specified region. By default, the namespaces listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `instance_id` and `project_id` parameters. * @@ -91,7 +95,6 @@ export class API extends ParentAPI { listNamespaces = (request: Readonly = {}) => enrichForPagination('namespaces', this.pageOfListNamespaces, request) - /** * Get a namespace. Retrieve information about a given namespace, specified by its `namespace_id` and region. Full details about the namespace, such as `description`, `project_id`, `status`, `endpoint`, `is_public`, `size`, and `image_count` are returned in the response. * @@ -106,7 +109,7 @@ export class API extends ParentAPI { }, unmarshalNamespace, ) - + /** * Waits for {@link Namespace} to be in a final state. * @@ -119,13 +122,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!NAMESPACE_TRANSIENT_STATUSES_REGISTRY.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !NAMESPACE_TRANSIENT_STATUSES_REGISTRY.includes(res.status), + )), this.getNamespace, request, options, ) - /** * Create a namespace. Create a new Container Registry namespace. You must specify the namespace name and region in which you want it to be created. Optionally, you can specify the `project_id` and `is_public` in the request payload. * @@ -145,7 +151,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Update a namespace. Update the parameters of a given namespace, specified by its `namespace_id` and `region`. You can update the `description` and `is_public` parameters. * @@ -165,7 +170,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - /** * Delete a namespace. Delete a given namespace. You must specify, in the endpoint, the `region` and `namespace_id` parameters of the namespace you want to delete. * @@ -181,7 +185,6 @@ export class API extends ParentAPI { unmarshalNamespace, ) - protected pageOfListImages = (request: Readonly = {}) => this.client.fetch( { @@ -193,13 +196,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListImagesResponse, ) - + /** * List images. List all images in a specified region. By default, the images listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `namespace_id` and `project_id` parameters. * @@ -209,7 +215,6 @@ export class API extends ParentAPI { listImages = (request: Readonly = {}) => enrichForPagination('images', this.pageOfListImages, request) - /** * Get an image. Retrieve information about a given container image, specified by its `image_id` and region. Full details about the image, such as `name`, `namespace_id`, `status`, `visibility`, and `size` are returned in the response. * @@ -224,7 +229,7 @@ export class API extends ParentAPI { }, unmarshalImage, ) - + /** * Waits for {@link Image} to be in a final state. * @@ -237,13 +242,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!IMAGE_TRANSIENT_STATUSES_REGISTRY.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !IMAGE_TRANSIENT_STATUSES_REGISTRY.includes(res.status), + )), this.getImage, request, options, ) - /** * Update an image. Update the parameters of a given image, specified by its `image_id` and `region`. You can update the `visibility` parameter. * @@ -263,7 +271,6 @@ export class API extends ParentAPI { unmarshalImage, ) - /** * Delete an image. Delete a given image. You must specify, in the endpoint, the `region` and `image_id` parameters of the image you want to delete. * @@ -279,7 +286,6 @@ export class API extends ParentAPI { unmarshalImage, ) - protected pageOfListTags = (request: Readonly) => this.client.fetch( { @@ -289,12 +295,15 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListTagsResponse, ) - + /** * List tags. List all tags for a given image, specified by region. By default, the tags listed are ordered by creation date in ascending order. This can be modified via the order_by field. You can also define additional parameters for your query, such as the `name`. * @@ -304,7 +313,6 @@ export class API extends ParentAPI { listTags = (request: Readonly) => enrichForPagination('tags', this.pageOfListTags, request) - /** * Get a tag. Retrieve information about a given image tag, specified by its `tag_id` and region. Full details about the tag, such as `name`, `image_id`, `status`, and `digest` are returned in the response. * @@ -319,7 +327,7 @@ export class API extends ParentAPI { }, unmarshalTag, ) - + /** * Waits for {@link Tag} to be in a final state. * @@ -332,13 +340,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!TAG_TRANSIENT_STATUSES_REGISTRY.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !TAG_TRANSIENT_STATUSES_REGISTRY.includes(res.status), + )), this.getTag, request, options, ) - /** * Delete a tag. Delete a given image tag. You must specify, in the endpoint, the `region` and `tag_id` parameters of the tag you want to delete. * @@ -350,13 +361,8 @@ export class API extends ParentAPI { { method: 'DELETE', path: `/registry/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags/${validatePathParam('tagId', request.tagId)}`, - urlParams: urlParams( - ['force', request.force], - ), + urlParams: urlParams(['force', request.force]), }, unmarshalTag, ) - - } - diff --git a/packages_generated/registry/src/v1/content.gen.ts b/packages_generated/registry/src/v1/content.gen.ts index 252e4be53..7fb07f7cc 100644 --- a/packages_generated/registry/src/v1/content.gen.ts +++ b/packages_generated/registry/src/v1/content.gen.ts @@ -1,24 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - ImageStatus, - NamespaceStatus, - TagStatus, -} from './types.gen.js' - +import type { ImageStatus, NamespaceStatus, TagStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link ImageStatus}. */ -export const IMAGE_TRANSIENT_STATUSES: ImageStatus[] = [ - 'deleting', -] +export const IMAGE_TRANSIENT_STATUSES: ImageStatus[] = ['deleting'] /** Lists transient statutes of the enum {@link NamespaceStatus}. */ -export const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[] = [ - 'deleting', -] +export const NAMESPACE_TRANSIENT_STATUSES: NamespaceStatus[] = ['deleting'] /** Lists transient statutes of the enum {@link TagStatus}. */ -export const TAG_TRANSIENT_STATUSES: TagStatus[] = [ - 'deleting', -] - +export const TAG_TRANSIENT_STATUSES: TagStatus[] = ['deleting'] diff --git a/packages_generated/registry/src/v1/index.gen.ts b/packages_generated/registry/src/v1/index.gen.ts index 5f99865ca..d670570cc 100644 --- a/packages_generated/registry/src/v1/index.gen.ts +++ b/packages_generated/registry/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/registry/src/v1/marshalling.gen.ts b/packages_generated/registry/src/v1/marshalling.gen.ts index 1153fec52..46c1165c2 100644 --- a/packages_generated/registry/src/v1/marshalling.gen.ts +++ b/packages_generated/registry/src/v1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Image, @@ -79,7 +84,9 @@ export const unmarshalTag = (data: unknown): Tag => { } as Tag } -export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse => { +export const unmarshalListImagesResponse = ( + data: unknown, +): ListImagesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListImagesResponse' failed as data isn't a dictionary.`, @@ -92,7 +99,9 @@ export const unmarshalListImagesResponse = (data: unknown): ListImagesResponse = } as ListImagesResponse } -export const unmarshalListNamespacesResponse = (data: unknown): ListNamespacesResponse => { +export const unmarshalListNamespacesResponse = ( + data: unknown, +): ListNamespacesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListNamespacesResponse' failed as data isn't a dictionary.`, @@ -124,12 +133,16 @@ export const marshalCreateNamespaceRequest = ( ): Record => ({ description: request.description, is_public: request.isPublic, - name: request.name || randomName('ns'), + name: request.name || randomName('ns'), ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), diff --git a/packages_generated/registry/src/v1/types.gen.ts b/packages_generated/registry/src/v1/types.gen.ts index 6d6e5362c..a9441669f 100644 --- a/packages_generated/registry/src/v1/types.gen.ts +++ b/packages_generated/registry/src/v1/types.gen.ts @@ -1,14 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' +import type { Region as ScwRegion } from '@scaleway/sdk-client' - -export type ImageStatus = - | 'unknown' - | 'ready' - | 'deleting' - | 'error' - | 'locked' +export type ImageStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' export type ImageVisibility = | 'visibility_unknown' @@ -43,12 +37,7 @@ export type NamespaceStatus = | 'error' | 'locked' -export type TagStatus = - | 'unknown' - | 'ready' - | 'deleting' - | 'error' - | 'locked' +export type TagStatus = 'unknown' | 'ready' | 'deleting' | 'error' | 'locked' export interface Image { /** @@ -93,7 +82,6 @@ export interface Image { tags: string[] } - export interface Namespace { /** * UUID of the namespace. @@ -153,7 +141,6 @@ export interface Namespace { region: ScwRegion } - export interface Tag { /** * UUID of the tag. @@ -185,7 +172,6 @@ export interface Tag { updatedAt?: Date } - export type CreateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -217,7 +203,6 @@ export type CreateNamespaceRequest = { isPublic: boolean } - export type DeleteImageRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -229,7 +214,6 @@ export type DeleteImageRequest = { imageId: string } - export type DeleteNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -241,7 +225,6 @@ export type DeleteNamespaceRequest = { namespaceId: string } - export type DeleteTagRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -257,7 +240,6 @@ export type DeleteTagRequest = { force?: boolean } - export type GetImageRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -269,7 +251,6 @@ export type GetImageRequest = { imageId: string } - export type GetNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -281,7 +262,6 @@ export type GetNamespaceRequest = { namespaceId: string } - export type GetTagRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -293,7 +273,6 @@ export type GetTagRequest = { tagId: string } - export type ListImagesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -329,7 +308,6 @@ export type ListImagesRequest = { projectId?: string } - export interface ListImagesResponse { /** * Paginated list of images that match the selected filters. @@ -341,7 +319,6 @@ export interface ListImagesResponse { totalCount: number } - export type ListNamespacesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -373,7 +350,6 @@ export type ListNamespacesRequest = { name?: string } - export interface ListNamespacesResponse { /** * Paginated list of namespaces that match the selected filters. @@ -385,7 +361,6 @@ export interface ListNamespacesResponse { totalCount: number } - export type ListTagsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -413,7 +388,6 @@ export type ListTagsRequest = { name?: string } - export interface ListTagsResponse { /** * Paginated list of tags that match the selected filters. @@ -425,7 +399,6 @@ export interface ListTagsResponse { totalCount: number } - export type UpdateImageRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -441,7 +414,6 @@ export type UpdateImageRequest = { visibility?: ImageVisibility } - export type UpdateNamespaceRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -460,5 +432,3 @@ export type UpdateNamespaceRequest = { */ isPublic?: boolean } - - diff --git a/packages_generated/s2s_vpn/src/v1alpha1/api.gen.ts b/packages_generated/s2s_vpn/src/v1alpha1/api.gen.ts index d341c9448..9257189f8 100644 --- a/packages_generated/s2s_vpn/src/v1alpha1/api.gen.ts +++ b/packages_generated/s2s_vpn/src/v1alpha1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {VPN_GATEWAY_TRANSIENT_STATUSES as VPN_GATEWAY_TRANSIENT_STATUSES_S2S_VPN,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { VPN_GATEWAY_TRANSIENT_STATUSES as VPN_GATEWAY_TRANSIENT_STATUSES_S2S_VPN } from './content.gen.js' import { unmarshalConnection, marshalCreateConnectionRequest, @@ -87,28 +87,28 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListVpnGatewayTypes = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListVpnGatewayTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpn-gateway-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListVpnGatewayTypesResponse, ) - + /** * List VPN gateway types. List the different VPN gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available VPN gateway type. * @@ -118,8 +118,9 @@ export class API extends ParentAPI { listVpnGatewayTypes = (request: Readonly = {}) => enrichForPagination('gatewayTypes', this.pageOfListVpnGatewayTypes, request) - - protected pageOfListVpnGateways = (request: Readonly = {}) => + protected pageOfListVpnGateways = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -129,7 +130,10 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['statuses', request.statuses], @@ -138,7 +142,7 @@ export class API extends ParentAPI { }, unmarshalListVpnGatewaysResponse, ) - + /** * List VPN gateways. List all your VPN gateways. A number of filters are available, including Project ID, name, tags and status. * @@ -148,7 +152,6 @@ export class API extends ParentAPI { listVpnGateways = (request: Readonly = {}) => enrichForPagination('gateways', this.pageOfListVpnGateways, request) - /** * Get a VPN gateway. Get a VPN gateway for the given VPN gateway ID. * @@ -163,7 +166,7 @@ export class API extends ParentAPI { }, unmarshalVpnGateway, ) - + /** * Waits for {@link VpnGateway} to be in a final state. * @@ -176,13 +179,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!VPN_GATEWAY_TRANSIENT_STATUSES_S2S_VPN.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !VPN_GATEWAY_TRANSIENT_STATUSES_S2S_VPN.includes(res.status), + )), this.getVpnGateway, request, options, ) - /** * Create VPN gateway. * @@ -202,7 +208,6 @@ export class API extends ParentAPI { unmarshalVpnGateway, ) - /** * Update a VPN gateway. Update an existing VPN gateway, specified by its VPN gateway ID. Only its name and tags can be updated. * @@ -222,7 +227,6 @@ export class API extends ParentAPI { unmarshalVpnGateway, ) - /** * Delete a VPN gateway. Delete an existing VPN gateway, specified by its VPN gateway ID. * @@ -238,8 +242,9 @@ export class API extends ParentAPI { unmarshalVpnGateway, ) - - protected pageOfListConnections = (request: Readonly = {}) => + protected pageOfListConnections = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -250,7 +255,10 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['route_propagation_enabled', request.routePropagationEnabled], ['routing_policy_ids', request.routingPolicyIds], @@ -261,7 +269,7 @@ export class API extends ParentAPI { }, unmarshalListConnectionsResponse, ) - + /** * List connections. List all your connections. A number of filters are available, including Project ID, name, tags and status. * @@ -271,7 +279,6 @@ export class API extends ParentAPI { listConnections = (request: Readonly = {}) => enrichForPagination('connections', this.pageOfListConnections, request) - /** * Get a connection. Get a connection for the given connection ID. The response object includes information about the connection's various configuration details. * @@ -287,7 +294,6 @@ export class API extends ParentAPI { unmarshalConnection, ) - /** * Create a connection. * @@ -307,7 +313,6 @@ export class API extends ParentAPI { unmarshalCreateConnectionResponse, ) - /** * Update a connection. Update an existing connection, specified by its connection ID. * @@ -327,21 +332,17 @@ export class API extends ParentAPI { unmarshalConnection, ) - /** * Delete a connection. Delete an existing connection, specified by its connection ID. * * @param request - The request {@link DeleteConnectionRequest} */ deleteConnection = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam('connectionId', request.connectionId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/connections/${validatePathParam('connectionId', request.connectionId)}`, + }) - /** * Renew pre-shared key. Renew pre-shared key for a given connection. * @@ -359,7 +360,6 @@ export class API extends ParentAPI { unmarshalRenewConnectionPskResponse, ) - /** * Set a new routing policy. Set a new routing policy on a connection, overriding the existing one if present, specified by its connection ID. * @@ -379,7 +379,6 @@ export class API extends ParentAPI { unmarshalConnection, ) - /** * Detach a routing policy. Detach an existing routing policy from a connection, specified by its connection ID. * @@ -399,7 +398,6 @@ export class API extends ParentAPI { unmarshalConnection, ) - /** * Enable route propagation. Enable all allowed prefixes (defined in a routing policy) to be announced in the BGP session. This allows traffic to flow between the attached VPC and the on-premises infrastructure along the announced routes. Note that by default, even when route propagation is enabled, all routes are blocked. It is essential to attach a routing policy to define the ranges of routes to announce. * @@ -417,14 +415,15 @@ export class API extends ParentAPI { unmarshalConnection, ) - /** * Disable route propagation. Prevent any prefixes from being announced in the BGP session. Traffic will not be able to flow over the VPN Gateway until route propagation is re-enabled. * * @param request - The request {@link DisableRoutePropagationRequest} * @returns A Promise of Connection */ - disableRoutePropagation = (request: Readonly) => + disableRoutePropagation = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -435,8 +434,9 @@ export class API extends ParentAPI { unmarshalConnection, ) - - protected pageOfListCustomerGateways = (request: Readonly = {}) => + protected pageOfListCustomerGateways = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -445,24 +445,27 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListCustomerGatewaysResponse, ) - + /** * List customer gateways. List all your customer gateways. A number of filters are available, including Project ID, name, and tags. * * @param request - The request {@link ListCustomerGatewaysRequest} * @returns A Promise of ListCustomerGatewaysResponse */ - listCustomerGateways = (request: Readonly = {}) => - enrichForPagination('gateways', this.pageOfListCustomerGateways, request) + listCustomerGateways = ( + request: Readonly = {}, + ) => enrichForPagination('gateways', this.pageOfListCustomerGateways, request) - /** * Get a customer gateway. Get a customer gateway for the given customer gateway ID. * @@ -478,7 +481,6 @@ export class API extends ParentAPI { unmarshalCustomerGateway, ) - /** * Create a customer gateway. * @@ -498,7 +500,6 @@ export class API extends ParentAPI { unmarshalCustomerGateway, ) - /** * Update a customer gateway. Update an existing customer gateway, specified by its customer gateway ID. You can update its name, tags, public IPv4 & IPv6 address and AS Number. * @@ -518,22 +519,20 @@ export class API extends ParentAPI { unmarshalCustomerGateway, ) - /** * Delete a customer gateway. Delete an existing customer gateway, specified by its customer gateway ID. * * @param request - The request {@link DeleteCustomerGatewayRequest} */ deleteCustomerGateway = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam('gatewayId', request.gatewayId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/customer-gateways/${validatePathParam('gatewayId', request.gatewayId)}`, + }) - - protected pageOfListRoutingPolicies = (request: Readonly = {}) => + protected pageOfListRoutingPolicies = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -543,14 +542,17 @@ export class API extends ParentAPI { ['name', request.name], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['tags', request.tags], ), }, unmarshalListRoutingPoliciesResponse, ) - + /** * List routing policies. List all routing policies in a given region. A routing policy can be attached to one or multiple connections (S2S VPN connections). * @@ -558,9 +560,12 @@ export class API extends ParentAPI { * @returns A Promise of ListRoutingPoliciesResponse */ listRoutingPolicies = (request: Readonly = {}) => - enrichForPagination('routingPolicies', this.pageOfListRoutingPolicies, request) + enrichForPagination( + 'routingPolicies', + this.pageOfListRoutingPolicies, + request, + ) - /** * Get routing policy. Get a routing policy for the given routing policy ID. The response object gives information including the policy's name, tags and prefix filters. * @@ -576,7 +581,6 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Create a routing policy. Create a routing policy. Routing policies allow you to set IP prefix filters to define the incoming route announcements to accept from the customer gateway, and the outgoing routes to announce to the customer gateway. * @@ -596,7 +600,6 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Update a routing policy. Update an existing routing policy, specified by its routing policy ID. Its name, tags and incoming/outgoing prefix filters can be updated. * @@ -616,20 +619,14 @@ export class API extends ParentAPI { unmarshalRoutingPolicy, ) - /** * Delete a routing policy. Delete an existing routing policy, specified by its routing policy ID. * * @param request - The request {@link DeleteRoutingPolicyRequest} */ deleteRoutingPolicy = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam('routingPolicyId', request.routingPolicyId)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/s2s-vpn/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routing-policies/${validatePathParam('routingPolicyId', request.routingPolicyId)}`, + }) } - diff --git a/packages_generated/s2s_vpn/src/v1alpha1/content.gen.ts b/packages_generated/s2s_vpn/src/v1alpha1/content.gen.ts index c24a06043..9064c9a00 100644 --- a/packages_generated/s2s_vpn/src/v1alpha1/content.gen.ts +++ b/packages_generated/s2s_vpn/src/v1alpha1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - VpnGatewayStatus, -} from './types.gen.js' - +import type { VpnGatewayStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link VpnGatewayStatus}. */ export const VPN_GATEWAY_TRANSIENT_STATUSES: VpnGatewayStatus[] = [ @@ -11,4 +8,3 @@ export const VPN_GATEWAY_TRANSIENT_STATUSES: VpnGatewayStatus[] = [ 'provisioning', 'deprovisioning', ] - diff --git a/packages_generated/s2s_vpn/src/v1alpha1/index.gen.ts b/packages_generated/s2s_vpn/src/v1alpha1/index.gen.ts index 1cfc6ec45..2811d8403 100644 --- a/packages_generated/s2s_vpn/src/v1alpha1/index.gen.ts +++ b/packages_generated/s2s_vpn/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/s2s_vpn/src/v1alpha1/marshalling.gen.ts b/packages_generated/s2s_vpn/src/v1alpha1/marshalling.gen.ts index f8b880323..110158927 100644 --- a/packages_generated/s2s_vpn/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/s2s_vpn/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { BgpSession, @@ -68,15 +72,25 @@ export const unmarshalConnection = (data: unknown): Connection => { } return { - bgpSessionIpv4: data.bgp_session_ipv4 ? unmarshalBgpSession(data.bgp_session_ipv4) : undefined, - bgpSessionIpv6: data.bgp_session_ipv6 ? unmarshalBgpSession(data.bgp_session_ipv6) : undefined, + bgpSessionIpv4: data.bgp_session_ipv4 + ? unmarshalBgpSession(data.bgp_session_ipv4) + : undefined, + bgpSessionIpv6: data.bgp_session_ipv6 + ? unmarshalBgpSession(data.bgp_session_ipv6) + : undefined, bgpStatusIpv4: data.bgp_status_ipv4, bgpStatusIpv6: data.bgp_status_ipv6, createdAt: unmarshalDate(data.created_at), customerGatewayId: data.customer_gateway_id, - espCiphers: unmarshalArrayOfObject(data.esp_ciphers, unmarshalConnectionCipher), + espCiphers: unmarshalArrayOfObject( + data.esp_ciphers, + unmarshalConnectionCipher, + ), id: data.id, - ikev2Ciphers: unmarshalArrayOfObject(data.ikev2_ciphers, unmarshalConnectionCipher), + ikev2Ciphers: unmarshalArrayOfObject( + data.ikev2_ciphers, + unmarshalConnectionCipher, + ), initiationPolicy: data.initiation_policy, isIpv6: data.is_ipv6, name: data.name, @@ -89,8 +103,12 @@ export const unmarshalConnection = (data: unknown): Connection => { status: data.status, tags: data.tags, tunnelStatus: data.tunnel_status, - tunnelStatusIpv4: data.tunnel_status_ipv4 ? data.tunnel_status_ipv4 : undefined, - tunnelStatusIpv6: data.tunnel_status_ipv6 ? data.tunnel_status_ipv6 : undefined, + tunnelStatusIpv4: data.tunnel_status_ipv4 + ? data.tunnel_status_ipv4 + : undefined, + tunnelStatusIpv6: data.tunnel_status_ipv6 + ? data.tunnel_status_ipv6 + : undefined, updatedAt: unmarshalDate(data.updated_at), vpnGatewayId: data.vpn_gateway_id, } as Connection @@ -139,18 +157,21 @@ export const unmarshalRoutingPolicy = (data: unknown): RoutingPolicy => { } as RoutingPolicy } -const unmarshalVpnGatewayPrivateConfig = (data: unknown): VpnGatewayPrivateConfig => { +const unmarshalVpnGatewayPrivateConfig = ( + data: unknown, +): VpnGatewayPrivateConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VpnGatewayPrivateConfig' failed as data isn't a dictionary.`, ) } - return { - } as VpnGatewayPrivateConfig + return {} as VpnGatewayPrivateConfig } -const unmarshalVpnGatewayPublicConfig = (data: unknown): VpnGatewayPublicConfig => { +const unmarshalVpnGatewayPublicConfig = ( + data: unknown, +): VpnGatewayPublicConfig => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'VpnGatewayPublicConfig' failed as data isn't a dictionary.`, @@ -179,10 +200,14 @@ export const unmarshalVpnGateway = (data: unknown): VpnGateway => { ipamPrivateIpv6Id: data.ipam_private_ipv6_id, name: data.name, organizationId: data.organization_id, - privateConfig: data.private_config ? unmarshalVpnGatewayPrivateConfig(data.private_config) : undefined, + privateConfig: data.private_config + ? unmarshalVpnGatewayPrivateConfig(data.private_config) + : undefined, privateNetworkId: data.private_network_id, projectId: data.project_id, - publicConfig: data.public_config ? unmarshalVpnGatewayPublicConfig(data.public_config) : undefined, + publicConfig: data.public_config + ? unmarshalVpnGatewayPublicConfig(data.public_config) + : undefined, region: data.region, status: data.status, tags: data.tags, @@ -191,7 +216,9 @@ export const unmarshalVpnGateway = (data: unknown): VpnGateway => { } as VpnGateway } -export const unmarshalCreateConnectionResponse = (data: unknown): CreateConnectionResponse => { +export const unmarshalCreateConnectionResponse = ( + data: unknown, +): CreateConnectionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateConnectionResponse' failed as data isn't a dictionary.`, @@ -199,12 +226,16 @@ export const unmarshalCreateConnectionResponse = (data: unknown): CreateConnecti } return { - connection: data.connection ? unmarshalConnection(data.connection) : undefined, + connection: data.connection + ? unmarshalConnection(data.connection) + : undefined, preSharedKey: data.pre_shared_key, } as CreateConnectionResponse } -export const unmarshalListConnectionsResponse = (data: unknown): ListConnectionsResponse => { +export const unmarshalListConnectionsResponse = ( + data: unknown, +): ListConnectionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListConnectionsResponse' failed as data isn't a dictionary.`, @@ -217,7 +248,9 @@ export const unmarshalListConnectionsResponse = (data: unknown): ListConnections } as ListConnectionsResponse } -export const unmarshalListCustomerGatewaysResponse = (data: unknown): ListCustomerGatewaysResponse => { +export const unmarshalListCustomerGatewaysResponse = ( + data: unknown, +): ListCustomerGatewaysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListCustomerGatewaysResponse' failed as data isn't a dictionary.`, @@ -230,7 +263,9 @@ export const unmarshalListCustomerGatewaysResponse = (data: unknown): ListCustom } as ListCustomerGatewaysResponse } -export const unmarshalListRoutingPoliciesResponse = (data: unknown): ListRoutingPoliciesResponse => { +export const unmarshalListRoutingPoliciesResponse = ( + data: unknown, +): ListRoutingPoliciesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRoutingPoliciesResponse' failed as data isn't a dictionary.`, @@ -238,7 +273,10 @@ export const unmarshalListRoutingPoliciesResponse = (data: unknown): ListRouting } return { - routingPolicies: unmarshalArrayOfObject(data.routing_policies, unmarshalRoutingPolicy), + routingPolicies: unmarshalArrayOfObject( + data.routing_policies, + unmarshalRoutingPolicy, + ), totalCount: data.total_count, } as ListRoutingPoliciesResponse } @@ -259,7 +297,9 @@ const unmarshalGatewayType = (data: unknown): GatewayType => { } as GatewayType } -export const unmarshalListVpnGatewayTypesResponse = (data: unknown): ListVpnGatewayTypesResponse => { +export const unmarshalListVpnGatewayTypesResponse = ( + data: unknown, +): ListVpnGatewayTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVpnGatewayTypesResponse' failed as data isn't a dictionary.`, @@ -267,12 +307,17 @@ export const unmarshalListVpnGatewayTypesResponse = (data: unknown): ListVpnGate } return { - gatewayTypes: unmarshalArrayOfObject(data.gateway_types, unmarshalGatewayType), + gatewayTypes: unmarshalArrayOfObject( + data.gateway_types, + unmarshalGatewayType, + ), totalCount: data.total_count, } as ListVpnGatewayTypesResponse } -export const unmarshalListVpnGatewaysResponse = (data: unknown): ListVpnGatewaysResponse => { +export const unmarshalListVpnGatewaysResponse = ( + data: unknown, +): ListVpnGatewaysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListVpnGatewaysResponse' failed as data isn't a dictionary.`, @@ -285,7 +330,9 @@ export const unmarshalListVpnGatewaysResponse = (data: unknown): ListVpnGateways } as ListVpnGatewaysResponse } -export const unmarshalRenewConnectionPskResponse = (data: unknown): RenewConnectionPskResponse => { +export const unmarshalRenewConnectionPskResponse = ( + data: unknown, +): RenewConnectionPskResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RenewConnectionPskResponse' failed as data isn't a dictionary.`, @@ -293,7 +340,9 @@ export const unmarshalRenewConnectionPskResponse = (data: unknown): RenewConnect } return { - connection: data.connection ? unmarshalConnection(data.connection) : undefined, + connection: data.connection + ? unmarshalConnection(data.connection) + : undefined, preSharedKey: data.pre_shared_key, } as RenewConnectionPskResponse } @@ -320,12 +369,22 @@ export const marshalCreateConnectionRequest = ( request: CreateConnectionRequest, defaults: DefaultValues, ): Record => ({ - bgp_config_ipv4: ((request.bgpConfigIpv4 !== undefined) ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4, defaults): undefined), - bgp_config_ipv6: ((request.bgpConfigIpv6 !== undefined) ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6, defaults): undefined), + bgp_config_ipv4: + request.bgpConfigIpv4 !== undefined + ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv4, defaults) + : undefined, + bgp_config_ipv6: + request.bgpConfigIpv6 !== undefined + ? marshalCreateConnectionRequestBgpConfig(request.bgpConfigIpv6, defaults) + : undefined, customer_gateway_id: request.customerGatewayId, enable_route_propagation: request.enableRoutePropagation, - esp_ciphers: request.espCiphers.map(elt => marshalConnectionCipher(elt, defaults)), - ikev2_ciphers: request.ikev2Ciphers.map(elt => marshalConnectionCipher(elt, defaults)), + esp_ciphers: request.espCiphers.map(elt => + marshalConnectionCipher(elt, defaults), + ), + ikev2_ciphers: request.ikev2Ciphers.map(elt => + marshalConnectionCipher(elt, defaults), + ), initiation_policy: request.initiationPolicy, is_ipv6: request.isIpv6, name: request.name, @@ -377,11 +436,17 @@ export const marshalCreateVpnGatewayRequest = ( private_network_id: request.privateNetworkId, project_id: request.projectId ?? defaults.defaultProjectId, tags: request.tags, - zone: request.zone ?? defaults.defaultZone, + zone: request.zone ?? defaults.defaultZone, ...resolveOneOf([ - {param: 'public_config', - value: (request.publicConfig !== undefined) ? marshalCreateVpnGatewayRequestPublicConfig(request.publicConfig, defaults) - : undefined, + { + param: 'public_config', + value: + request.publicConfig !== undefined + ? marshalCreateVpnGatewayRequestPublicConfig( + request.publicConfig, + defaults, + ) + : undefined, }, ]), }) @@ -389,28 +454,20 @@ export const marshalCreateVpnGatewayRequest = ( export const marshalDetachRoutingPolicyRequest = ( request: DetachRoutingPolicyRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'routing_policy_v4', - value: request.routingPolicyV4, - }, - {param: 'routing_policy_v6', - value: request.routingPolicyV6, - }, + { param: 'routing_policy_v4', value: request.routingPolicyV4 }, + { param: 'routing_policy_v6', value: request.routingPolicyV6 }, ]), }) export const marshalSetRoutingPolicyRequest = ( request: SetRoutingPolicyRequest, defaults: DefaultValues, -): Record => ({ +): Record => ({ ...resolveOneOf([ - {param: 'routing_policy_v4', - value: request.routingPolicyV4, - }, - {param: 'routing_policy_v6', - value: request.routingPolicyV6, - }, + { param: 'routing_policy_v4', value: request.routingPolicyV4 }, + { param: 'routing_policy_v6', value: request.routingPolicyV6 }, ]), }) @@ -418,8 +475,14 @@ export const marshalUpdateConnectionRequest = ( request: UpdateConnectionRequest, defaults: DefaultValues, ): Record => ({ - esp_ciphers: ((request.espCiphers !== undefined) ? request.espCiphers.map(elt => marshalConnectionCipher(elt, defaults)): undefined), - ikev2_ciphers: ((request.ikev2Ciphers !== undefined) ? request.ikev2Ciphers.map(elt => marshalConnectionCipher(elt, defaults)): undefined), + esp_ciphers: + request.espCiphers !== undefined + ? request.espCiphers.map(elt => marshalConnectionCipher(elt, defaults)) + : undefined, + ikev2_ciphers: + request.ikev2Ciphers !== undefined + ? request.ikev2Ciphers.map(elt => marshalConnectionCipher(elt, defaults)) + : undefined, initiation_policy: request.initiationPolicy, name: request.name, tags: request.tags, diff --git a/packages_generated/s2s_vpn/src/v1alpha1/types.gen.ts b/packages_generated/s2s_vpn/src/v1alpha1/types.gen.ts index 9ca882d22..08daadeed 100644 --- a/packages_generated/s2s_vpn/src/v1alpha1/types.gen.ts +++ b/packages_generated/s2s_vpn/src/v1alpha1/types.gen.ts @@ -1,13 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' - -export type BgpSessionStatus = - | 'unknown_status' - | 'up' - | 'down' - | 'disabled' +export type BgpSessionStatus = 'unknown_status' | 'up' | 'down' | 'disabled' export type ConnectionDhGroup = | 'unknown_dhgroup' @@ -84,10 +79,7 @@ export type ListVpnGatewaysRequestOrderBy = | 'status_asc' | 'status_desc' -export type TunnelStatus = - | 'unknown_tunnel_status' - | 'up' - | 'down' +export type TunnelStatus = 'unknown_tunnel_status' | 'up' | 'down' export type VpnGatewayStatus = | 'unknown_status' @@ -104,31 +96,25 @@ export interface BgpSession { peerPrivateIp: string } - export interface ConnectionCipher { encryption: ConnectionEncryption integrity?: ConnectionIntegrity dhGroup?: ConnectionDhGroup } - -export interface VpnGatewayPrivateConfig { -} - +export interface VpnGatewayPrivateConfig {} export interface VpnGatewayPublicConfig { ipamIpv4Id?: string ipamIpv6Id?: string } - export interface CreateConnectionRequestBgpConfig { routingPolicyId: string privateIp?: string peerPrivateIp?: string } - export interface Connection { /** * Unique identifier of the connection. @@ -232,13 +218,11 @@ export interface Connection { region: ScwRegion } - export interface CreateVpnGatewayRequestPublicConfig { ipamIpv4Id?: string ipamIpv6Id?: string } - export interface CustomerGateway { /** * Unique identifier of the customer gateway. @@ -282,7 +266,6 @@ export interface CustomerGateway { asn: number } - export interface RoutingPolicy { /** * Unique identifier of the routing policy. @@ -330,7 +313,6 @@ export interface RoutingPolicy { region: ScwRegion } - export interface GatewayType { name: string bandwidth: number @@ -342,7 +324,6 @@ export interface GatewayType { region: ScwRegion } - export interface VpnGateway { /** * Unique identifier of the VPN gateway. @@ -417,7 +398,6 @@ export interface VpnGateway { region: ScwRegion } - export type CreateConnectionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -473,7 +453,6 @@ export type CreateConnectionRequest = { bgpConfigIpv6?: CreateConnectionRequestBgpConfig } - export interface CreateConnectionResponse { /** * This connection. @@ -485,7 +464,6 @@ export interface CreateConnectionResponse { preSharedKey?: string } - export type CreateCustomerGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -517,7 +495,6 @@ export type CreateCustomerGatewayRequest = { asn: number } - export type CreateRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -549,7 +526,6 @@ export type CreateRoutingPolicyRequest = { prefixFilterOut?: string[] } - export type CreateVpnGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -595,7 +571,6 @@ export type CreateVpnGatewayRequest = { zone?: ScwZone } - export type DeleteConnectionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -607,7 +582,6 @@ export type DeleteConnectionRequest = { connectionId: string } - export type DeleteCustomerGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -619,7 +593,6 @@ export type DeleteCustomerGatewayRequest = { gatewayId: string } - export type DeleteRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -631,7 +604,6 @@ export type DeleteRoutingPolicyRequest = { routingPolicyId: string } - export type DeleteVpnGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -643,7 +615,6 @@ export type DeleteVpnGatewayRequest = { gatewayId: string } - export type DetachRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -667,7 +638,6 @@ export type DetachRoutingPolicyRequest = { routingPolicyV6?: string } - export type DisableRoutePropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -679,7 +649,6 @@ export type DisableRoutePropagationRequest = { connectionId: string } - export type EnableRoutePropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -691,7 +660,6 @@ export type EnableRoutePropagationRequest = { connectionId: string } - export type GetConnectionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -703,7 +671,6 @@ export type GetConnectionRequest = { connectionId: string } - export type GetCustomerGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -715,7 +682,6 @@ export type GetCustomerGatewayRequest = { gatewayId: string } - export type GetRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -727,7 +693,6 @@ export type GetRoutingPolicyRequest = { routingPolicyId: string } - export type GetVpnGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -739,7 +704,6 @@ export type GetVpnGatewayRequest = { gatewayId: string } - export type ListConnectionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -795,7 +759,6 @@ export type ListConnectionsRequest = { customerGatewayIds?: string[] } - export interface ListConnectionsResponse { /** * List of connections on the current page. @@ -807,7 +770,6 @@ export interface ListConnectionsResponse { totalCount: number } - export type ListCustomerGatewaysRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -839,7 +801,6 @@ export type ListCustomerGatewaysRequest = { tags?: string[] } - export interface ListCustomerGatewaysResponse { /** * List of customer gateways on the current page. @@ -851,7 +812,6 @@ export interface ListCustomerGatewaysResponse { totalCount: number } - export type ListRoutingPoliciesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -887,13 +847,11 @@ export type ListRoutingPoliciesRequest = { ipv6?: boolean } - export interface ListRoutingPoliciesResponse { routingPolicies: RoutingPolicy[] totalCount: number } - export type ListVpnGatewayTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -909,7 +867,6 @@ export type ListVpnGatewayTypesRequest = { pageSize?: number } - export interface ListVpnGatewayTypesResponse { /** * List of VPN gateway types on the current page. @@ -921,7 +878,6 @@ export interface ListVpnGatewayTypesResponse { totalCount: number } - export type ListVpnGatewaysRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -965,7 +921,6 @@ export type ListVpnGatewaysRequest = { privateNetworkIds?: string[] } - export interface ListVpnGatewaysResponse { /** * List of VPN gateways on the current page. @@ -977,7 +932,6 @@ export interface ListVpnGatewaysResponse { totalCount: number } - export type RenewConnectionPskRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -989,7 +943,6 @@ export type RenewConnectionPskRequest = { connectionId: string } - export interface RenewConnectionPskResponse { /** * This connection. @@ -1001,7 +954,6 @@ export interface RenewConnectionPskResponse { preSharedKey?: string } - export type SetRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1025,7 +977,6 @@ export type SetRoutingPolicyRequest = { routingPolicyV6?: string } - export type UpdateConnectionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1057,7 +1008,6 @@ export type UpdateConnectionRequest = { espCiphers?: ConnectionCipher[] } - export type UpdateCustomerGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1089,7 +1039,6 @@ export type UpdateCustomerGatewayRequest = { asn?: number } - export type UpdateRoutingPolicyRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1117,7 +1066,6 @@ export type UpdateRoutingPolicyRequest = { prefixFilterOut?: string[] } - export type UpdateVpnGatewayRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1136,5 +1084,3 @@ export type UpdateVpnGatewayRequest = { */ tags?: string[] } - - diff --git a/packages_generated/secret/src/v1beta1/api.gen.ts b/packages_generated/secret/src/v1beta1/api.gen.ts index 85d9f9207..619ffc47f 100644 --- a/packages_generated/secret/src/v1beta1/api.gen.ts +++ b/packages_generated/secret/src/v1beta1/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { unmarshalAccessSecretVersionResponse, marshalAddSecretOwnerRequest, @@ -70,15 +70,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Create a secret. Create a secret in a given region specified by the `region` parameter. * @@ -98,7 +93,6 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Get metadata using the secret's ID. Retrieve the metadata of a secret specified by the `region` and `secret_id` parameters. * @@ -114,7 +108,6 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Update metadata of a secret. Edit a secret's metadata such as name, tag(s), description and ephemeral policy. The secret to update is specified by the `secret_id` and `region` parameters. * @@ -134,21 +127,17 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Delete a secret. Delete a given secret specified by the `region` and `secret_id` parameters. * * @param request - The request {@link DeleteSecretRequest} */ deleteSecret = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}`, + }) - protected pageOfListSecrets = (request: Readonly) => this.client.fetch( { @@ -160,7 +149,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['path', request.path], ['project_id', request.projectId], ['scheduled_for_deletion', request.scheduledForDeletion], @@ -170,7 +162,7 @@ export class API extends ParentAPI { }, unmarshalListSecretsResponse, ) - + /** * List secrets. Retrieve the list of secrets created within an Organization and/or Project. You must specify either the `organization_id` or the `project_id` and the `region`. * @@ -180,7 +172,6 @@ export class API extends ParentAPI { listSecrets = (request: Readonly) => enrichForPagination('secrets', this.pageOfListSecrets, request) - /** * Browse secrets. Retrieve the list of secrets and folders for the given prefix. You must specify either the `organization_id` or the `project_id` and the `region`. * @@ -195,7 +186,10 @@ export class API extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['prefix', request.prefix], ['project_id', request.projectId], ['tags', request.tags], @@ -205,7 +199,6 @@ export class API extends ParentAPI { unmarshalBrowseSecretsResponse, ) - /** * Enable secret protection. Enable secret protection for a given secret specified by the `secret_id` parameter. Enabling secret protection means that your secret can be read and modified, but it cannot be deleted. * @@ -223,7 +216,6 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Disable secret protection. Disable secret protection for a given secret specified by the `secret_id` parameter. Disabling secret protection means that your secret can be read, modified and deleted. * @@ -241,25 +233,21 @@ export class API extends ParentAPI { unmarshalSecret, ) - /** * Allow a product to use the secret. * * @param request - The request {@link AddSecretOwnerRequest} */ addSecretOwner = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalAddSecretOwnerRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`, - }, - ) + this.client.fetch({ + body: JSON.stringify( + marshalAddSecretOwnerRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/add-owner`, + }) - /** * Create a version. Create a version of a given secret specified by the `region` and `secret_id` parameters. * @@ -279,7 +267,6 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - /** * Get metadata of a secret's version using the secret's ID. Retrieve the metadata of a secret's given version specified by the `region`, `secret_id` and `revision` parameters. * @@ -295,7 +282,6 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - /** * Update metadata of a version. Edit the metadata of a secret's given version, specified by the `region`, `secret_id` and `revision` parameters. * @@ -315,35 +301,36 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - /** * Delete a version. Delete a secret's version and the sensitive data contained in it. Deleting a version is permanent and cannot be undone. * * @param request - The request {@link DeleteSecretVersionRequest} */ deleteSecretVersion = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions/${validatePathParam('revision', request.revision)}`, + }) - - protected pageOfListSecretVersions = (request: Readonly) => + protected pageOfListSecretVersions = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets/${validatePathParam('secretId', request.secretId)}/versions`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['status', request.status], ), }, unmarshalListSecretVersionsResponse, ) - + /** * List versions of a secret using the secret's ID. Retrieve the list of a given secret's versions specified by the `secret_id` and `region` parameters. * @@ -353,7 +340,6 @@ export class API extends ParentAPI { listSecretVersions = (request: Readonly) => enrichForPagination('versions', this.pageOfListSecretVersions, request) - /** * Access a secret's version using the secret's ID. Access sensitive data in a secret's version specified by the `region`, `secret_id` and `revision` parameters. * @@ -369,20 +355,24 @@ export class API extends ParentAPI { unmarshalAccessSecretVersionResponse, ) - /** * Access a secret's version using the secret's name and path. Access sensitive data in a secret's version specified by the `region`, `secret_name`, `secret_path` and `revision` parameters. * * @param request - The request {@link AccessSecretVersionByPathRequest} * @returns A Promise of AccessSecretVersionResponse */ - accessSecretVersionByPath = (request: Readonly) => + accessSecretVersionByPath = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secrets-by-path/versions/${validatePathParam('revision', request.revision)}/access`, urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ['secret_name', request.secretName], ['secret_path', request.secretPath], ), @@ -390,7 +380,6 @@ export class API extends ParentAPI { unmarshalAccessSecretVersionResponse, ) - /** * Enable a version. Make a specific version accessible. You must specify the `region`, `secret_id` and `revision` parameters. * @@ -408,7 +397,6 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - /** * Disable a version. Make a specific version inaccessible. You must specify the `region`, `secret_id` and `revision` parameters. * @@ -426,7 +414,6 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - protected pageOfListTags = (request: Readonly = {}) => this.client.fetch( { @@ -434,13 +421,19 @@ export class API extends ParentAPI { path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tags`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListTagsResponse, ) - + /** * List tags. List all tags associated with secrets within a given Project. * @@ -450,21 +443,28 @@ export class API extends ParentAPI { listTags = (request: Readonly = {}) => enrichForPagination('tags', this.pageOfListTags, request) - - protected pageOfListSecretTypes = (request: Readonly = {}) => + protected pageOfListSecretTypes = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/secret-manager/v1beta1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/secret-types`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListSecretTypesResponse, ) - + /** * List secret types. List all secret types created within a given Project. * @@ -474,7 +474,6 @@ export class API extends ParentAPI { listSecretTypes = (request: Readonly = {}) => enrichForPagination('types', this.pageOfListSecretTypes, request) - /** * Restore a version. Restore a secret's version specified by the `region`, `secret_id` and `revision` parameters. * @@ -492,7 +491,6 @@ export class API extends ParentAPI { unmarshalSecretVersion, ) - /** * Restore a secret. Restore a secret and all its versions scheduled for deletion specified by the `region` and `secret_id` parameters. * @@ -509,7 +507,4 @@ export class API extends ParentAPI { }, unmarshalSecret, ) - - } - diff --git a/packages_generated/secret/src/v1beta1/index.gen.ts b/packages_generated/secret/src/v1beta1/index.gen.ts index e948491ac..d1cb28ec8 100644 --- a/packages_generated/secret/src/v1beta1/index.gen.ts +++ b/packages_generated/secret/src/v1beta1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { AccessSecretVersionByPathRequest, diff --git a/packages_generated/secret/src/v1beta1/marshalling.gen.ts b/packages_generated/secret/src/v1beta1/marshalling.gen.ts index a23c8354b..a2ce34a7e 100644 --- a/packages_generated/secret/src/v1beta1/marshalling.gen.ts +++ b/packages_generated/secret/src/v1beta1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EphemeralProperties, @@ -48,7 +51,9 @@ export const unmarshalSecretVersion = (data: unknown): SecretVersion => { deletedAt: unmarshalDate(data.deleted_at), deletionRequestedAt: unmarshalDate(data.deletion_requested_at), description: data.description, - ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) : undefined, + ephemeralProperties: data.ephemeral_properties + ? unmarshalEphemeralProperties(data.ephemeral_properties) + : undefined, latest: data.latest, region: data.region, revision: data.revision, @@ -83,7 +88,9 @@ export const unmarshalSecret = (data: unknown): Secret => { createdAt: unmarshalDate(data.created_at), deletionRequestedAt: unmarshalDate(data.deletion_requested_at), description: data.description, - ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined, + ephemeralPolicy: data.ephemeral_policy + ? unmarshalEphemeralPolicy(data.ephemeral_policy) + : undefined, id: data.id, keyId: data.key_id, managed: data.managed, @@ -101,7 +108,9 @@ export const unmarshalSecret = (data: unknown): Secret => { } as Secret } -export const unmarshalAccessSecretVersionResponse = (data: unknown): AccessSecretVersionResponse => { +export const unmarshalAccessSecretVersionResponse = ( + data: unknown, +): AccessSecretVersionResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AccessSecretVersionResponse' failed as data isn't a dictionary.`, @@ -117,18 +126,21 @@ export const unmarshalAccessSecretVersionResponse = (data: unknown): AccessSecre } as AccessSecretVersionResponse } -const unmarshalBrowseSecretsResponseItemFolderDetails = (data: unknown): BrowseSecretsResponseItemFolderDetails => { +const unmarshalBrowseSecretsResponseItemFolderDetails = ( + data: unknown, +): BrowseSecretsResponseItemFolderDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BrowseSecretsResponseItemFolderDetails' failed as data isn't a dictionary.`, ) } - return { - } as BrowseSecretsResponseItemFolderDetails + return {} as BrowseSecretsResponseItemFolderDetails } -const unmarshalBrowseSecretsResponseItemSecretDetails = (data: unknown): BrowseSecretsResponseItemSecretDetails => { +const unmarshalBrowseSecretsResponseItemSecretDetails = ( + data: unknown, +): BrowseSecretsResponseItemSecretDetails => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BrowseSecretsResponseItemSecretDetails' failed as data isn't a dictionary.`, @@ -136,7 +148,9 @@ const unmarshalBrowseSecretsResponseItemSecretDetails = (data: unknown): BrowseS } return { - ephemeralPolicy: data.ephemeral_policy ? unmarshalEphemeralPolicy(data.ephemeral_policy) : undefined, + ephemeralPolicy: data.ephemeral_policy + ? unmarshalEphemeralPolicy(data.ephemeral_policy) + : undefined, id: data.id, protected: data.protected, tags: data.tags, @@ -145,7 +159,9 @@ const unmarshalBrowseSecretsResponseItemSecretDetails = (data: unknown): BrowseS } as BrowseSecretsResponseItemSecretDetails } -const unmarshalBrowseSecretsResponseItem = (data: unknown): BrowseSecretsResponseItem => { +const unmarshalBrowseSecretsResponseItem = ( + data: unknown, +): BrowseSecretsResponseItem => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BrowseSecretsResponseItem' failed as data isn't a dictionary.`, @@ -154,14 +170,20 @@ const unmarshalBrowseSecretsResponseItem = (data: unknown): BrowseSecretsRespons return { createdAt: unmarshalDate(data.created_at), - folder: data.folder ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) : undefined, + folder: data.folder + ? unmarshalBrowseSecretsResponseItemFolderDetails(data.folder) + : undefined, name: data.name, - secret: data.secret ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) : undefined, + secret: data.secret + ? unmarshalBrowseSecretsResponseItemSecretDetails(data.secret) + : undefined, updatedAt: unmarshalDate(data.updated_at), } as BrowseSecretsResponseItem } -export const unmarshalBrowseSecretsResponse = (data: unknown): BrowseSecretsResponse => { +export const unmarshalBrowseSecretsResponse = ( + data: unknown, +): BrowseSecretsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BrowseSecretsResponse' failed as data isn't a dictionary.`, @@ -170,12 +192,17 @@ export const unmarshalBrowseSecretsResponse = (data: unknown): BrowseSecretsResp return { currentPath: data.current_path, - items: unmarshalArrayOfObject(data.items, unmarshalBrowseSecretsResponseItem), + items: unmarshalArrayOfObject( + data.items, + unmarshalBrowseSecretsResponseItem, + ), totalCount: data.total_count, } as BrowseSecretsResponse } -export const unmarshalListSecretTypesResponse = (data: unknown): ListSecretTypesResponse => { +export const unmarshalListSecretTypesResponse = ( + data: unknown, +): ListSecretTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecretTypesResponse' failed as data isn't a dictionary.`, @@ -188,7 +215,9 @@ export const unmarshalListSecretTypesResponse = (data: unknown): ListSecretTypes } as ListSecretTypesResponse } -export const unmarshalListSecretVersionsResponse = (data: unknown): ListSecretVersionsResponse => { +export const unmarshalListSecretVersionsResponse = ( + data: unknown, +): ListSecretVersionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecretVersionsResponse' failed as data isn't a dictionary.`, @@ -201,7 +230,9 @@ export const unmarshalListSecretVersionsResponse = (data: unknown): ListSecretVe } as ListSecretVersionsResponse } -export const unmarshalListSecretsResponse = (data: unknown): ListSecretsResponse => { +export const unmarshalListSecretsResponse = ( + data: unknown, +): ListSecretsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSecretsResponse' failed as data isn't a dictionary.`, @@ -248,7 +279,10 @@ export const marshalCreateSecretRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - ephemeral_policy: ((request.ephemeralPolicy !== undefined) ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults): undefined), + ephemeral_policy: + request.ephemeralPolicy !== undefined + ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults) + : undefined, key_id: request.keyId, name: request.name, path: request.path, @@ -273,7 +307,10 @@ export const marshalUpdateSecretRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - ephemeral_policy: ((request.ephemeralPolicy !== undefined) ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults): undefined), + ephemeral_policy: + request.ephemeralPolicy !== undefined + ? marshalEphemeralPolicy(request.ephemeralPolicy, defaults) + : undefined, name: request.name, path: request.path, tags: request.tags, @@ -293,5 +330,8 @@ export const marshalUpdateSecretVersionRequest = ( defaults: DefaultValues, ): Record => ({ description: request.description, - ephemeral_properties: ((request.ephemeralProperties !== undefined) ? marshalEphemeralProperties(request.ephemeralProperties, defaults): undefined), + ephemeral_properties: + request.ephemeralProperties !== undefined + ? marshalEphemeralProperties(request.ephemeralProperties, defaults) + : undefined, }) diff --git a/packages_generated/secret/src/v1beta1/types.gen.ts b/packages_generated/secret/src/v1beta1/types.gen.ts index 7f2b73e30..055429ae1 100644 --- a/packages_generated/secret/src/v1beta1/types.gen.ts +++ b/packages_generated/secret/src/v1beta1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type BrowseSecretsRequestOrderBy = | 'name_asc' @@ -11,10 +10,7 @@ export type BrowseSecretsRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type EphemeralPolicyAction = - | 'unknown_action' - | 'delete' - | 'disable' +export type EphemeralPolicyAction = 'unknown_action' | 'delete' | 'disable' export type ListSecretsRequestOrderBy = | 'name_asc' @@ -24,15 +20,9 @@ export type ListSecretsRequestOrderBy = | 'updated_at_asc' | 'updated_at_desc' -export type Product = - | 'unknown_product' - | 'edge_services' - | 's2s_vpn' +export type Product = 'unknown_product' | 'edge_services' | 's2s_vpn' -export type SecretStatus = - | 'unknown_status' - | 'ready' - | 'locked' +export type SecretStatus = 'unknown_status' | 'ready' | 'locked' export type SecretType = | 'unknown_type' @@ -65,10 +55,7 @@ export interface EphemeralPolicy { action: EphemeralPolicyAction } - -export interface BrowseSecretsResponseItemFolderDetails { -} - +export interface BrowseSecretsResponseItemFolderDetails {} export interface BrowseSecretsResponseItemSecretDetails { id: string @@ -79,7 +66,6 @@ export interface BrowseSecretsResponseItemSecretDetails { type: SecretType } - export interface EphemeralProperties { /** * (Optional.) If not specified, the version does not have an expiration date. @@ -95,7 +81,6 @@ export interface EphemeralProperties { action: EphemeralPolicyAction } - export interface BrowseSecretsResponseItem { name: string createdAt?: Date @@ -112,7 +97,6 @@ export interface BrowseSecretsResponseItem { folder?: BrowseSecretsResponseItemFolderDetails } - export interface SecretVersion { /** * The first version of the secret is numbered 1, and all subsequent revisions augment by 1. @@ -124,10 +108,10 @@ export interface SecretVersion { secretId: string /** * * `unknown_status`: the version is in an invalid state. -* `enabled`: the version is accessible. -* `disabled`: the version is not accessible but can be enabled. -* `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days. -* `deleted`: the version is permanently deleted. It is not possible to recover it. + * `enabled`: the version is accessible. + * `disabled`: the version is not accessible but can be enabled. + * `scheduled_for_deletion`: the version is scheduled for deletion. It will be deleted in 7 days. + * `deleted`: the version is permanently deleted. It is not possible to recover it. */ status: SecretVersionStatus /** @@ -164,7 +148,6 @@ export interface SecretVersion { region: ScwRegion } - export interface Secret { /** * ID of the secret. @@ -180,7 +163,7 @@ export interface Secret { name: string /** * * `ready`: the secret can be read, modified and deleted. -* `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway. + * `locked`: no action can be performed on the secret. This status can only be applied and removed by Scaleway. */ status: SecretStatus /** @@ -241,7 +224,6 @@ export interface Secret { region: ScwRegion } - export type AccessSecretVersionByPathRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -268,7 +250,6 @@ export type AccessSecretVersionByPathRequest = { projectId?: string } - export type AccessSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -287,7 +268,6 @@ export type AccessSecretVersionRequest = { revision: string } - export interface AccessSecretVersionResponse { /** * ID of the secret. @@ -311,7 +291,6 @@ export interface AccessSecretVersionResponse { type: SecretType } - export type AddSecretOwnerRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -327,7 +306,6 @@ export type AddSecretOwnerRequest = { product?: Product } - export interface BasicCredentials { /** * The username or identifier associated with the credentials. @@ -339,7 +317,6 @@ export interface BasicCredentials { password: string } - export type BrowseSecretsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -366,7 +343,6 @@ export type BrowseSecretsRequest = { type?: SecretType } - export interface BrowseSecretsResponse { /** * Repeated item of type secret or folder, sorted by the request parameter. @@ -382,7 +358,6 @@ export interface BrowseSecretsResponse { totalCount: number } - export type CreateSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -426,7 +401,6 @@ export type CreateSecretRequest = { keyId?: string } - export type CreateSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -454,7 +428,6 @@ export type CreateSecretVersionRequest = { dataCrc32?: number } - export interface DatabaseCredentials { /** * Supported database engines are: 'postgres', 'mysql', 'other'. @@ -482,7 +455,6 @@ export interface DatabaseCredentials { port: string } - export type DeleteSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -494,7 +466,6 @@ export type DeleteSecretRequest = { secretId: string } - export type DeleteSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -513,7 +484,6 @@ export type DeleteSecretVersionRequest = { revision: string } - export type DisableSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -532,7 +502,6 @@ export type DisableSecretVersionRequest = { revision: string } - export type EnableSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -551,7 +520,6 @@ export type EnableSecretVersionRequest = { revision: string } - export type GetSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -563,7 +531,6 @@ export type GetSecretRequest = { secretId: string } - export type GetSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -582,7 +549,6 @@ export type GetSecretVersionRequest = { revision: string } - export type ListSecretTypesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -596,7 +562,6 @@ export type ListSecretTypesRequest = { pageSize?: number } - export interface ListSecretTypesResponse { /** * List of secret types. @@ -608,7 +573,6 @@ export interface ListSecretTypesResponse { totalCount: number } - export type ListSecretVersionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -626,7 +590,6 @@ export type ListSecretVersionsRequest = { status?: SecretVersionStatus[] } - export interface ListSecretVersionsResponse { /** * Single page of versions. @@ -638,7 +601,6 @@ export interface ListSecretVersionsResponse { totalCount: number } - export type ListSecretsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -681,7 +643,6 @@ export type ListSecretsRequest = { scheduledForDeletion: boolean } - export interface ListSecretsResponse { /** * Single page of secrets matching the requested criteria. @@ -693,7 +654,6 @@ export interface ListSecretsResponse { totalCount: number } - export type ListTagsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -707,7 +667,6 @@ export type ListTagsRequest = { pageSize?: number } - export interface ListTagsResponse { /** * List of tags. @@ -719,7 +678,6 @@ export interface ListTagsResponse { totalCount: number } - export type ProtectSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -731,7 +689,6 @@ export type ProtectSecretRequest = { secretId: string } - export type RestoreSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -740,7 +697,6 @@ export type RestoreSecretRequest = { secretId: string } - export type RestoreSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -750,7 +706,6 @@ export type RestoreSecretVersionRequest = { revision: string } - export interface SSHKey { /** * The private SSH key. @@ -758,7 +713,6 @@ export interface SSHKey { sshPrivateKey: string } - export type UnprotectSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -770,7 +724,6 @@ export type UnprotectSecretRequest = { secretId: string } - export type UpdateSecretRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -802,7 +755,6 @@ export type UpdateSecretRequest = { ephemeralPolicy?: EphemeralPolicy } - export type UpdateSecretVersionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -828,5 +780,3 @@ export type UpdateSecretVersionRequest = { */ ephemeralProperties?: EphemeralProperties } - - diff --git a/packages_generated/serverless_sqldb/src/v1alpha1/api.gen.ts b/packages_generated/serverless_sqldb/src/v1alpha1/api.gen.ts index 3ebb82252..65e0e6cd7 100644 --- a/packages_generated/serverless_sqldb/src/v1alpha1/api.gen.ts +++ b/packages_generated/serverless_sqldb/src/v1alpha1/api.gen.ts @@ -8,8 +8,8 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DATABASE_TRANSIENT_STATUSES as DATABASE_TRANSIENT_STATUSES_SERVERLESS_SQLDB,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { DATABASE_TRANSIENT_STATUSES as DATABASE_TRANSIENT_STATUSES_SERVERLESS_SQLDB } from './content.gen.js' import { marshalCreateDatabaseRequest, unmarshalDatabase, @@ -49,13 +49,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + /** * Create a new Serverless SQL Database. You must provide the following parameters: `organization_id`, `project_id`, `name`, `cpu_min`, `cpu_max`. You can also provide `from_backup_id` to create a database from a backup. * @@ -75,7 +72,6 @@ export class API extends ParentAPI { unmarshalDatabase, ) - /** * Get a database information. Retrieve information about your Serverless SQL Database. You must provide the `database_id` parameter. * @@ -90,7 +86,7 @@ export class API extends ParentAPI { }, unmarshalDatabase, ) - + /** * Waits for {@link Database} to be in a final state. * @@ -103,13 +99,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DATABASE_TRANSIENT_STATUSES_SERVERLESS_SQLDB.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DATABASE_TRANSIENT_STATUSES_SERVERLESS_SQLDB.includes(res.status), + )), this.getDatabase, request, options, ) - /** * Delete a database. Deletes a database. You must provide the `database_id` parameter. All data stored in the database will be permanently deleted. * @@ -125,8 +124,9 @@ export class API extends ParentAPI { unmarshalDatabase, ) - - protected pageOfListDatabases = (request: Readonly = {}) => + protected pageOfListDatabases = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -137,12 +137,15 @@ export class API extends ParentAPI { ['organization_id', request.organizationId], ['page', request.page], ['page_size', request.pageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListDatabasesResponse, ) - + /** * List your Serverless SQL Databases. List all Serverless SQL Databases for a given Scaleway Organization or Scaleway Project. By default, the databases returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. For the `name` parameter, the value you include will be checked against the whole name string to see if it includes the string you put in the parameter. * @@ -152,7 +155,6 @@ export class API extends ParentAPI { listDatabases = (request: Readonly = {}) => enrichForPagination('databases', this.pageOfListDatabases, request) - /** * Update database information. Update CPU limits of your Serverless SQL Database. You must provide the `database_id` parameter. * @@ -172,18 +174,22 @@ export class API extends ParentAPI { unmarshalDatabase, ) - /** * Restore a database from a backup. Restore a database from a backup. You must provide the `backup_id` parameter. * * @param request - The request {@link RestoreDatabaseFromBackupRequest} * @returns A Promise of Database */ - restoreDatabaseFromBackup = (request: Readonly) => + restoreDatabaseFromBackup = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalRestoreDatabaseFromBackupRequest(request, this.client.settings), + marshalRestoreDatabaseFromBackupRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -192,7 +198,6 @@ export class API extends ParentAPI { unmarshalDatabase, ) - /** * Get a database backup information. Retrieve information about your Serverless SQL Database backup. You must provide the `backup_id` parameter. * @@ -208,8 +213,9 @@ export class API extends ParentAPI { unmarshalDatabaseBackup, ) - - protected pageOfListDatabaseBackups = (request: Readonly) => + protected pageOfListDatabaseBackups = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -225,7 +231,7 @@ export class API extends ParentAPI { }, unmarshalListDatabaseBackupsResponse, ) - + /** * List your Serverless SQL Database backups. List all Serverless SQL Database backups for a given Scaleway Project or Database. By default, the backups returned in the list are ordered by creation date in descending order, though this can be modified via the order_by field. * @@ -235,7 +241,6 @@ export class API extends ParentAPI { listDatabaseBackups = (request: Readonly) => enrichForPagination('backups', this.pageOfListDatabaseBackups, request) - /** * Export a database backup. Export a database backup providing a download link once the export process is completed. You must provide the `backup_id` parameter. * @@ -252,7 +257,4 @@ export class API extends ParentAPI { }, unmarshalDatabaseBackup, ) - - } - diff --git a/packages_generated/serverless_sqldb/src/v1alpha1/content.gen.ts b/packages_generated/serverless_sqldb/src/v1alpha1/content.gen.ts index ab4d289e5..62ecfc1fa 100644 --- a/packages_generated/serverless_sqldb/src/v1alpha1/content.gen.ts +++ b/packages_generated/serverless_sqldb/src/v1alpha1/content.gen.ts @@ -1,9 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - DatabaseStatus, -} from './types.gen.js' - +import type { DatabaseStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link DatabaseStatus}. */ export const DATABASE_TRANSIENT_STATUSES: DatabaseStatus[] = [ @@ -11,4 +8,3 @@ export const DATABASE_TRANSIENT_STATUSES: DatabaseStatus[] = [ 'deleting', 'restoring', ] - diff --git a/packages_generated/serverless_sqldb/src/v1alpha1/index.gen.ts b/packages_generated/serverless_sqldb/src/v1alpha1/index.gen.ts index cb1849616..515a68121 100644 --- a/packages_generated/serverless_sqldb/src/v1alpha1/index.gen.ts +++ b/packages_generated/serverless_sqldb/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/serverless_sqldb/src/v1alpha1/marshalling.gen.ts b/packages_generated/serverless_sqldb/src/v1alpha1/marshalling.gen.ts index 52684f6cc..60a63658a 100644 --- a/packages_generated/serverless_sqldb/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/serverless_sqldb/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { DatabaseBackup, @@ -58,7 +61,9 @@ export const unmarshalDatabase = (data: unknown): Database => { } as Database } -export const unmarshalListDatabaseBackupsResponse = (data: unknown): ListDatabaseBackupsResponse => { +export const unmarshalListDatabaseBackupsResponse = ( + data: unknown, +): ListDatabaseBackupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabaseBackupsResponse' failed as data isn't a dictionary.`, @@ -71,7 +76,9 @@ export const unmarshalListDatabaseBackupsResponse = (data: unknown): ListDatabas } as ListDatabaseBackupsResponse } -export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResponse => { +export const unmarshalListDatabasesResponse = ( + data: unknown, +): ListDatabasesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`, diff --git a/packages_generated/serverless_sqldb/src/v1alpha1/types.gen.ts b/packages_generated/serverless_sqldb/src/v1alpha1/types.gen.ts index e66ba6770..8b33e6927 100644 --- a/packages_generated/serverless_sqldb/src/v1alpha1/types.gen.ts +++ b/packages_generated/serverless_sqldb/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' - +import type { Region as ScwRegion } from '@scaleway/sdk-client' export type DatabaseBackupStatus = | 'unknown_status' @@ -79,7 +78,6 @@ export interface DatabaseBackup { region: ScwRegion } - export interface Database { /** * UUID that uniquely identifies your Serverless SQL DB Database. @@ -135,7 +133,6 @@ export interface Database { engineMajorVersion: number } - export type CreateDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -163,7 +160,6 @@ export type CreateDatabaseRequest = { fromBackupId?: string } - export type DeleteDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -175,7 +171,6 @@ export type DeleteDatabaseRequest = { databaseId: string } - export type ExportDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -187,7 +182,6 @@ export type ExportDatabaseBackupRequest = { backupId: string } - export type GetDatabaseBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -199,7 +193,6 @@ export type GetDatabaseBackupRequest = { backupId: string } - export type GetDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -211,7 +204,6 @@ export type GetDatabaseRequest = { databaseId: string } - export type ListDatabaseBackupsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -243,7 +235,6 @@ export type ListDatabaseBackupsRequest = { orderBy?: ListDatabaseBackupsRequestOrderBy } - export interface ListDatabaseBackupsResponse { /** * List of the backups. @@ -255,7 +246,6 @@ export interface ListDatabaseBackupsResponse { totalCount: number } - export type ListDatabasesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -287,7 +277,6 @@ export type ListDatabasesRequest = { orderBy?: ListDatabasesRequestOrderBy } - export interface ListDatabasesResponse { /** * List of the databases. @@ -299,7 +288,6 @@ export interface ListDatabasesResponse { totalCount: number } - export type RestoreDatabaseFromBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -315,7 +303,6 @@ export type RestoreDatabaseFromBackupRequest = { backupId: string } - export type UpdateDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -334,5 +321,3 @@ export type UpdateDatabaseRequest = { */ cpuMax?: number } - - diff --git a/packages_generated/tem/src/v1alpha1/api.gen.ts b/packages_generated/tem/src/v1alpha1/api.gen.ts index 785ac68cb..b8ab63e63 100644 --- a/packages_generated/tem/src/v1alpha1/api.gen.ts +++ b/packages_generated/tem/src/v1alpha1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_TEM,EMAIL_TRANSIENT_STATUSES as EMAIL_TRANSIENT_STATUSES_TEM,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_TEM, + EMAIL_TRANSIENT_STATUSES as EMAIL_TRANSIENT_STATUSES_TEM, +} from './content.gen.js' import { marshalBulkCreateBlocklistsRequest, unmarshalBulkCreateBlocklistsResponse, @@ -101,13 +104,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par'], + }) + /** * Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. * @@ -127,7 +127,6 @@ export class API extends ParentAPI { unmarshalCreateEmailResponse, ) - /** * Get an email. Retrieve information about a specific email using the `email_id` and `region` parameters. * @@ -142,7 +141,7 @@ export class API extends ParentAPI { }, unmarshalEmail, ) - + /** * Waits for {@link Email} to be in a final state. * @@ -155,13 +154,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!EMAIL_TRANSIENT_STATUSES_TEM.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!EMAIL_TRANSIENT_STATUSES_TEM.includes(res.status))), this.getEmail, request, options, ) - protected pageOfListEmails = (request: Readonly = {}) => this.client.fetch( { @@ -176,7 +176,10 @@ export class API extends ParentAPI { ['message_id', request.messageId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['search', request.search], ['since', request.since], @@ -187,7 +190,7 @@ export class API extends ParentAPI { }, unmarshalListEmailsResponse, ) - + /** * List emails. Retrieve the list of emails sent from a specific domain or for a specific Project or Organization. You must specify the `region`. * @@ -197,7 +200,6 @@ export class API extends ParentAPI { listEmails = (request: Readonly = {}) => enrichForPagination('emails', this.pageOfListEmails, request) - /** * Email statuses. Get information on your emails' statuses. * @@ -220,7 +222,6 @@ export class API extends ParentAPI { unmarshalStatistics, ) - /** * Cancel an email. You can cancel the sending of an email if it has not been sent yet. You must specify the `region` and the `email_id` of the email you want to cancel. * @@ -238,7 +239,6 @@ export class API extends ParentAPI { unmarshalEmail, ) - /** * Register a domain in a project. You must specify the `region`, `project_id` and `domain_name` to register a domain in a specific Project. * @@ -258,7 +258,6 @@ export class API extends ParentAPI { unmarshalDomain, ) - /** * Get information about a domain. Retrieve information about a specific domain using the `region` and `domain_id` parameters. Monitor your domain's reputation and improve **average** and **bad** reputation statuses, using your domain's **Email activity** tab on the [Scaleway console](https://console.scaleway.com/transactional-email/domains) to get a more detailed report. Check out our [dedicated documentation](https://www.scaleway.com/en/docs/managed-services/transactional-email/reference-content/understanding-tem-reputation-score/) to improve your domain's reputation. * @@ -273,7 +272,7 @@ export class API extends ParentAPI { }, unmarshalDomain, ) - + /** * Waits for {@link Domain} to be in a final state. * @@ -286,13 +285,14 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_TEM.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_TEM.includes(res.status))), this.getDomain, request, options, ) - protected pageOfListDomains = (request: Readonly = {}) => this.client.fetch( { @@ -302,14 +302,17 @@ export class API extends ParentAPI { ['name', request.name], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['status', request.status], ), }, unmarshalListDomainsResponse, ) - + /** * List domains. Retrieve domains in a specific Project or in a specific Organization using the `region` parameter. * @@ -319,7 +322,6 @@ export class API extends ParentAPI { listDomains = (request: Readonly = {}) => enrichForPagination('domains', this.pageOfListDomains, request) - /** * Delete a domain. You must specify the domain you want to delete by the `region` and `domain_id`. Deleting a domain is permanent and cannot be undone. * @@ -337,7 +339,6 @@ export class API extends ParentAPI { unmarshalDomain, ) - /** * Domain DNS check. Perform an immediate DNS check of a domain using the `region` and `domain_id` parameters. * @@ -355,7 +356,6 @@ export class API extends ParentAPI { unmarshalDomain, ) - /** * Display SPF, DKIM, DMARC and MX records status and potential errors. Display SPF, DKIM, DMARC and MX records status and potential errors, including the found records to make debugging easier. * @@ -371,7 +371,6 @@ export class API extends ParentAPI { unmarshalDomainLastStatus, ) - /** * Update a domain. Update a domain auto-configuration. * @@ -391,7 +390,6 @@ export class API extends ParentAPI { unmarshalDomain, ) - /** * Create a Webhook. Create a new Webhook triggered by a list of event types and pushed to a Scaleway SNS ARN. * @@ -411,8 +409,9 @@ export class API extends ParentAPI { unmarshalWebhook, ) - - protected pageOfListWebhooks = (request: Readonly = {}) => + protected pageOfListWebhooks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -422,13 +421,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListWebhooksResponse, ) - + /** * List Webhooks. Retrieve Webhooks in a specific Project or in a specific Organization using the `region` parameter. * @@ -438,7 +440,6 @@ export class API extends ParentAPI { listWebhooks = (request: Readonly = {}) => enrichForPagination('webhooks', this.pageOfListWebhooks, request) - /** * Get information about a Webhook. Retrieve information about a specific Webhook using the `webhook_id` and `region` parameters. * @@ -454,7 +455,6 @@ export class API extends ParentAPI { unmarshalWebhook, ) - /** * Update a Webhook. Update a Webhook events type, SNS ARN or name. * @@ -474,22 +474,20 @@ export class API extends ParentAPI { unmarshalWebhook, ) - /** * Delete a Webhook. You must specify the Webhook you want to delete by the `region` and `webhook_id`. Deleting a Webhook is permanent and cannot be undone. * * @param request - The request {@link DeleteWebhookRequest} */ deleteWebhook = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam('webhookId', request.webhookId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/webhooks/${validatePathParam('webhookId', request.webhookId)}`, + }) - - protected pageOfListWebhookEvents = (request: Readonly) => + protected pageOfListWebhookEvents = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -501,14 +499,17 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['statuses', request.statuses], ), }, unmarshalListWebhookEventsResponse, ) - + /** * List Webhook triggered events. Retrieve the list of Webhook events triggered from a specific Webhook or for a specific Project or Organization. You must specify the `region`. * @@ -518,7 +519,6 @@ export class API extends ParentAPI { listWebhookEvents = (request: Readonly) => enrichForPagination('webhookEvents', this.pageOfListWebhookEvents, request) - /** * List project settings. Retrieve the project settings including periodic reports. * @@ -534,14 +534,15 @@ export class API extends ParentAPI { unmarshalProjectSettings, ) - /** * Update project settings. Update the project settings including periodic reports. * * @param request - The request {@link UpdateProjectSettingsRequest} * @returns A Promise of ProjectSettings */ - updateProjectSettings = (request: Readonly = {}) => + updateProjectSettings = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( @@ -554,7 +555,6 @@ export class API extends ParentAPI { unmarshalProjectSettings, ) - protected pageOfListBlocklists = (request: Readonly) => this.client.fetch( { @@ -566,13 +566,16 @@ export class API extends ParentAPI { ['email', request.email], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['type', request.type], ), }, unmarshalListBlocklistsResponse, ) - + /** * List blocklists. Retrieve the list of blocklists. * @@ -582,7 +585,6 @@ export class API extends ParentAPI { listBlocklists = (request: Readonly) => enrichForPagination('blocklists', this.pageOfListBlocklists, request) - /** * Bulk create blocklists. Create multiple blocklists in a specific Project or Organization using the `region` parameter. * @@ -602,47 +604,47 @@ export class API extends ParentAPI { unmarshalBulkCreateBlocklistsResponse, ) - /** * Delete a blocklist. You must specify the blocklist you want to delete by the `region` and `blocklist_id`. * * @param request - The request {@link DeleteBlocklistRequest} */ deleteBlocklist = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/blocklists/${validatePathParam('blocklistId', request.blocklistId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/blocklists/${validatePathParam('blocklistId', request.blocklistId)}`, + }) - /** * Get information about subscribed offers. Retrieve information about the offers you are subscribed to using the `project_id` and `region` parameters. * * @param request - The request {@link ListOfferSubscriptionsRequest} * @returns A Promise of ListOfferSubscriptionsResponse */ - listOfferSubscriptions = (request: Readonly = {}) => + listOfferSubscriptions = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/offer-subscriptions`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalListOfferSubscriptionsResponse, ) - /** * Update a subscribed offer. * * @param request - The request {@link UpdateOfferSubscriptionRequest} * @returns A Promise of OfferSubscription */ - updateOfferSubscription = (request: Readonly = {}) => + updateOfferSubscription = ( + request: Readonly = {}, + ) => this.client.fetch( { body: JSON.stringify( @@ -655,7 +657,6 @@ export class API extends ParentAPI { unmarshalOfferSubscription, ) - /** * List the available offers.. Retrieve the list of the available and free-of-charge offers you can subscribe to. * @@ -671,7 +672,6 @@ export class API extends ParentAPI { unmarshalListOffersResponse, ) - protected pageOfListPools = (request: Readonly = {}) => this.client.fetch( { @@ -679,13 +679,19 @@ export class API extends ParentAPI { path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/pools`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalListPoolsResponse, ) - + /** * Get information about a sending pool.. Retrieve information about a sending pool, including its creation status and configuration parameters. * @@ -695,25 +701,24 @@ export class API extends ParentAPI { listPools = (request: Readonly = {}) => enrichForPagination('pools', this.pageOfListPools, request) - /** * Get project resource consumption.. Get project resource consumption. * * @param request - The request {@link GetProjectConsumptionRequest} * @returns A Promise of ProjectConsumption */ - getProjectConsumption = (request: Readonly = {}) => + getProjectConsumption = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/project-consumption`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalProjectConsumption, ) - - } - diff --git a/packages_generated/tem/src/v1alpha1/content.gen.ts b/packages_generated/tem/src/v1alpha1/content.gen.ts index b677b6953..adabcbea0 100644 --- a/packages_generated/tem/src/v1alpha1/content.gen.ts +++ b/packages_generated/tem/src/v1alpha1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - DomainStatus, - EmailStatus, -} from './types.gen.js' - +import type { DomainStatus, EmailStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link DomainStatus}. */ export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = [ @@ -13,8 +9,4 @@ export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = [ ] /** Lists transient statutes of the enum {@link EmailStatus}. */ -export const EMAIL_TRANSIENT_STATUSES: EmailStatus[] = [ - 'new', - 'sending', -] - +export const EMAIL_TRANSIENT_STATUSES: EmailStatus[] = ['new', 'sending'] diff --git a/packages_generated/tem/src/v1alpha1/index.gen.ts b/packages_generated/tem/src/v1alpha1/index.gen.ts index b6b04c52b..39bc3aa21 100644 --- a/packages_generated/tem/src/v1alpha1/index.gen.ts +++ b/packages_generated/tem/src/v1alpha1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/tem/src/v1alpha1/marshalling.gen.ts b/packages_generated/tem/src/v1alpha1/marshalling.gen.ts index 447f9f6b6..24e3418bc 100644 --- a/packages_generated/tem/src/v1alpha1/marshalling.gen.ts +++ b/packages_generated/tem/src/v1alpha1/marshalling.gen.ts @@ -1,5 +1,8 @@ - -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { EmailTry, @@ -211,15 +214,21 @@ export const unmarshalDomain = (data: unknown): Domain => { projectId: data.project_id, records: data.records ? unmarshalDomainRecords(data.records) : undefined, region: data.region, - reputation: data.reputation ? unmarshalDomainReputation(data.reputation) : undefined, + reputation: data.reputation + ? unmarshalDomainReputation(data.reputation) + : undefined, revokedAt: unmarshalDate(data.revoked_at), spfConfig: data.spf_config, - statistics: data.statistics ? unmarshalDomainStatistics(data.statistics) : undefined, + statistics: data.statistics + ? unmarshalDomainStatistics(data.statistics) + : undefined, status: data.status, } as Domain } -export const unmarshalOfferSubscription = (data: unknown): OfferSubscription => { +export const unmarshalOfferSubscription = ( + data: unknown, +): OfferSubscription => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'OfferSubscription' failed as data isn't a dictionary.`, @@ -281,7 +290,9 @@ const unmarshalBlocklist = (data: unknown): Blocklist => { } as Blocklist } -export const unmarshalBulkCreateBlocklistsResponse = (data: unknown): BulkCreateBlocklistsResponse => { +export const unmarshalBulkCreateBlocklistsResponse = ( + data: unknown, +): BulkCreateBlocklistsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'BulkCreateBlocklistsResponse' failed as data isn't a dictionary.`, @@ -293,7 +304,9 @@ export const unmarshalBulkCreateBlocklistsResponse = (data: unknown): BulkCreate } as BulkCreateBlocklistsResponse } -export const unmarshalCreateEmailResponse = (data: unknown): CreateEmailResponse => { +export const unmarshalCreateEmailResponse = ( + data: unknown, +): CreateEmailResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CreateEmailResponse' failed as data isn't a dictionary.`, @@ -305,7 +318,9 @@ export const unmarshalCreateEmailResponse = (data: unknown): CreateEmailResponse } as CreateEmailResponse } -const unmarshalDomainLastStatusAutoconfigState = (data: unknown): DomainLastStatusAutoconfigState => { +const unmarshalDomainLastStatusAutoconfigState = ( + data: unknown, +): DomainLastStatusAutoconfigState => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainLastStatusAutoconfigState' failed as data isn't a dictionary.`, @@ -319,7 +334,9 @@ const unmarshalDomainLastStatusAutoconfigState = (data: unknown): DomainLastStat } as DomainLastStatusAutoconfigState } -const unmarshalDomainLastStatusDkimRecord = (data: unknown): DomainLastStatusDkimRecord => { +const unmarshalDomainLastStatusDkimRecord = ( + data: unknown, +): DomainLastStatusDkimRecord => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainLastStatusDkimRecord' failed as data isn't a dictionary.`, @@ -333,7 +350,9 @@ const unmarshalDomainLastStatusDkimRecord = (data: unknown): DomainLastStatusDki } as DomainLastStatusDkimRecord } -const unmarshalDomainLastStatusDmarcRecord = (data: unknown): DomainLastStatusDmarcRecord => { +const unmarshalDomainLastStatusDmarcRecord = ( + data: unknown, +): DomainLastStatusDmarcRecord => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainLastStatusDmarcRecord' failed as data isn't a dictionary.`, @@ -347,7 +366,9 @@ const unmarshalDomainLastStatusDmarcRecord = (data: unknown): DomainLastStatusDm } as DomainLastStatusDmarcRecord } -const unmarshalDomainLastStatusMXRecord = (data: unknown): DomainLastStatusMXRecord => { +const unmarshalDomainLastStatusMXRecord = ( + data: unknown, +): DomainLastStatusMXRecord => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainLastStatusMXRecord' failed as data isn't a dictionary.`, @@ -361,7 +382,9 @@ const unmarshalDomainLastStatusMXRecord = (data: unknown): DomainLastStatusMXRec } as DomainLastStatusMXRecord } -const unmarshalDomainLastStatusSpfRecord = (data: unknown): DomainLastStatusSpfRecord => { +const unmarshalDomainLastStatusSpfRecord = ( + data: unknown, +): DomainLastStatusSpfRecord => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DomainLastStatusSpfRecord' failed as data isn't a dictionary.`, @@ -383,17 +406,29 @@ export const unmarshalDomainLastStatus = (data: unknown): DomainLastStatus => { } return { - autoconfigState: data.autoconfig_state ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) : undefined, - dkimRecord: data.dkim_record ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) : undefined, - dmarcRecord: data.dmarc_record ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) : undefined, + autoconfigState: data.autoconfig_state + ? unmarshalDomainLastStatusAutoconfigState(data.autoconfig_state) + : undefined, + dkimRecord: data.dkim_record + ? unmarshalDomainLastStatusDkimRecord(data.dkim_record) + : undefined, + dmarcRecord: data.dmarc_record + ? unmarshalDomainLastStatusDmarcRecord(data.dmarc_record) + : undefined, domainId: data.domain_id, domainName: data.domain_name, - mxRecord: data.mx_record ? unmarshalDomainLastStatusMXRecord(data.mx_record) : undefined, - spfRecord: data.spf_record ? unmarshalDomainLastStatusSpfRecord(data.spf_record) : undefined, + mxRecord: data.mx_record + ? unmarshalDomainLastStatusMXRecord(data.mx_record) + : undefined, + spfRecord: data.spf_record + ? unmarshalDomainLastStatusSpfRecord(data.spf_record) + : undefined, } as DomainLastStatus } -export const unmarshalListBlocklistsResponse = (data: unknown): ListBlocklistsResponse => { +export const unmarshalListBlocklistsResponse = ( + data: unknown, +): ListBlocklistsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBlocklistsResponse' failed as data isn't a dictionary.`, @@ -406,7 +441,9 @@ export const unmarshalListBlocklistsResponse = (data: unknown): ListBlocklistsRe } as ListBlocklistsResponse } -export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse => { +export const unmarshalListDomainsResponse = ( + data: unknown, +): ListDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDomainsResponse' failed as data isn't a dictionary.`, @@ -419,7 +456,9 @@ export const unmarshalListDomainsResponse = (data: unknown): ListDomainsResponse } as ListDomainsResponse } -export const unmarshalListEmailsResponse = (data: unknown): ListEmailsResponse => { +export const unmarshalListEmailsResponse = ( + data: unknown, +): ListEmailsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListEmailsResponse' failed as data isn't a dictionary.`, @@ -432,7 +471,9 @@ export const unmarshalListEmailsResponse = (data: unknown): ListEmailsResponse = } as ListEmailsResponse } -export const unmarshalListOfferSubscriptionsResponse = (data: unknown): ListOfferSubscriptionsResponse => { +export const unmarshalListOfferSubscriptionsResponse = ( + data: unknown, +): ListOfferSubscriptionsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOfferSubscriptionsResponse' failed as data isn't a dictionary.`, @@ -440,7 +481,10 @@ export const unmarshalListOfferSubscriptionsResponse = (data: unknown): ListOffe } return { - offerSubscriptions: unmarshalArrayOfObject(data.offer_subscriptions, unmarshalOfferSubscription), + offerSubscriptions: unmarshalArrayOfObject( + data.offer_subscriptions, + unmarshalOfferSubscription, + ), totalCount: data.total_count, } as ListOfferSubscriptionsResponse } @@ -465,7 +509,9 @@ const unmarshalOffer = (data: unknown): Offer => { } as Offer } -export const unmarshalListOffersResponse = (data: unknown): ListOffersResponse => { +export const unmarshalListOffersResponse = ( + data: unknown, +): ListOffersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`, @@ -495,7 +541,9 @@ const unmarshalPool = (data: unknown): Pool => { } as Pool } -export const unmarshalListPoolsResponse = (data: unknown): ListPoolsResponse => { +export const unmarshalListPoolsResponse = ( + data: unknown, +): ListPoolsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPoolsResponse' failed as data isn't a dictionary.`, @@ -530,7 +578,9 @@ const unmarshalWebhookEvent = (data: unknown): WebhookEvent => { } as WebhookEvent } -export const unmarshalListWebhookEventsResponse = (data: unknown): ListWebhookEventsResponse => { +export const unmarshalListWebhookEventsResponse = ( + data: unknown, +): ListWebhookEventsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListWebhookEventsResponse' failed as data isn't a dictionary.`, @@ -539,11 +589,16 @@ export const unmarshalListWebhookEventsResponse = (data: unknown): ListWebhookEv return { totalCount: data.total_count, - webhookEvents: unmarshalArrayOfObject(data.webhook_events, unmarshalWebhookEvent), + webhookEvents: unmarshalArrayOfObject( + data.webhook_events, + unmarshalWebhookEvent, + ), } as ListWebhookEventsResponse } -export const unmarshalListWebhooksResponse = (data: unknown): ListWebhooksResponse => { +export const unmarshalListWebhooksResponse = ( + data: unknown, +): ListWebhooksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListWebhooksResponse' failed as data isn't a dictionary.`, @@ -556,7 +611,9 @@ export const unmarshalListWebhooksResponse = (data: unknown): ListWebhooksRespon } as ListWebhooksResponse } -export const unmarshalProjectConsumption = (data: unknown): ProjectConsumption => { +export const unmarshalProjectConsumption = ( + data: unknown, +): ProjectConsumption => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ProjectConsumption' failed as data isn't a dictionary.`, @@ -573,7 +630,9 @@ export const unmarshalProjectConsumption = (data: unknown): ProjectConsumption = } as ProjectConsumption } -const unmarshalProjectSettingsPeriodicReport = (data: unknown): ProjectSettingsPeriodicReport => { +const unmarshalProjectSettingsPeriodicReport = ( + data: unknown, +): ProjectSettingsPeriodicReport => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ProjectSettingsPeriodicReport' failed as data isn't a dictionary.`, @@ -596,7 +655,9 @@ export const unmarshalProjectSettings = (data: unknown): ProjectSettings => { } return { - periodicReport: data.periodic_report ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) : undefined, + periodicReport: data.periodic_report + ? unmarshalProjectSettingsPeriodicReport(data.periodic_report) + : undefined, } as ProjectSettings } @@ -666,17 +727,36 @@ export const marshalCreateEmailRequest = ( request: CreateEmailRequest, defaults: DefaultValues, ): Record => ({ - additional_headers: ((request.additionalHeaders !== undefined) ? request.additionalHeaders.map(elt => marshalCreateEmailRequestHeader(elt, defaults)): undefined), - attachments: ((request.attachments !== undefined) ? request.attachments.map(elt => marshalCreateEmailRequestAttachment(elt, defaults)): undefined), - bcc: ((request.bcc !== undefined) ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt, defaults)): undefined), - cc: ((request.cc !== undefined) ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt, defaults)): undefined), - from: marshalCreateEmailRequestAddress(request.from, defaults), + additional_headers: + request.additionalHeaders !== undefined + ? request.additionalHeaders.map(elt => + marshalCreateEmailRequestHeader(elt, defaults), + ) + : undefined, + attachments: + request.attachments !== undefined + ? request.attachments.map(elt => + marshalCreateEmailRequestAttachment(elt, defaults), + ) + : undefined, + bcc: + request.bcc !== undefined + ? request.bcc.map(elt => marshalCreateEmailRequestAddress(elt, defaults)) + : undefined, + cc: + request.cc !== undefined + ? request.cc.map(elt => marshalCreateEmailRequestAddress(elt, defaults)) + : undefined, + from: marshalCreateEmailRequestAddress(request.from, defaults), html: request.html, project_id: request.projectId ?? defaults.defaultProjectId, send_before: request.sendBefore, subject: request.subject, text: request.text, - to: ((request.to !== undefined) ? request.to.map(elt => marshalCreateEmailRequestAddress(elt, defaults)): undefined), + to: + request.to !== undefined + ? request.to.map(elt => marshalCreateEmailRequestAddress(elt, defaults)) + : undefined, }) export const marshalCreateWebhookRequest = ( @@ -684,7 +764,8 @@ export const marshalCreateWebhookRequest = ( defaults: DefaultValues, ): Record => ({ domain_id: request.domainId, - event_types: ((request.eventTypes !== undefined) ? request.eventTypes: undefined), + event_types: + request.eventTypes !== undefined ? request.eventTypes : undefined, name: request.name, project_id: request.projectId ?? defaults.defaultProjectId, sns_arn: request.snsArn, @@ -719,14 +800,21 @@ export const marshalUpdateProjectSettingsRequest = ( request: UpdateProjectSettingsRequest, defaults: DefaultValues, ): Record => ({ - periodic_report: ((request.periodicReport !== undefined) ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport(request.periodicReport, defaults): undefined), + periodic_report: + request.periodicReport !== undefined + ? marshalUpdateProjectSettingsRequestUpdatePeriodicReport( + request.periodicReport, + defaults, + ) + : undefined, }) export const marshalUpdateWebhookRequest = ( request: UpdateWebhookRequest, defaults: DefaultValues, ): Record => ({ - event_types: ((request.eventTypes !== undefined) ? request.eventTypes: undefined), + event_types: + request.eventTypes !== undefined ? request.eventTypes : undefined, name: request.name, sns_arn: request.snsArn, }) diff --git a/packages_generated/tem/src/v1alpha1/types.gen.ts b/packages_generated/tem/src/v1alpha1/types.gen.ts index ac924ed9b..a1646540e 100644 --- a/packages_generated/tem/src/v1alpha1/types.gen.ts +++ b/packages_generated/tem/src/v1alpha1/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Region as ScwRegion, Zone as ScwZone } from '@scaleway/sdk-client' export type BlocklistType = | 'unknown_type' @@ -47,11 +46,7 @@ export type EmailFlag = | 'send_before_expiration' | 'blocklisted' -export type EmailRcptType = - | 'unknown_rcpt_type' - | 'to' - | 'cc' - | 'bcc' +export type EmailRcptType = 'unknown_rcpt_type' | 'to' | 'cc' | 'bcc' export type EmailStatus = | 'unknown' @@ -85,14 +80,9 @@ export type ListWebhookEventsRequestOrderBy = | 'created_at_desc' | 'created_at_asc' -export type ListWebhooksRequestOrderBy = - | 'created_at_desc' - | 'created_at_asc' +export type ListWebhooksRequestOrderBy = 'created_at_desc' | 'created_at_asc' -export type OfferName = - | 'unknown_name' - | 'essential' - | 'scale' +export type OfferName = 'unknown_name' | 'essential' | 'scale' export type PoolStatus = | 'unknown_status' @@ -135,7 +125,6 @@ export interface DomainRecordsDKIM { value: string } - export interface DomainRecordsDMARC { /** * Name of the DMARC TXT record. @@ -147,7 +136,6 @@ export interface DomainRecordsDMARC { value: string } - export interface DomainRecordsMX { /** * Name of the MX record. @@ -159,7 +147,6 @@ export interface DomainRecordsMX { value: string } - export interface DomainRecordsSPF { /** * Name of the SPF TXT record. @@ -171,7 +158,6 @@ export interface DomainRecordsSPF { value: string } - export interface EmailTry { /** * Rank number of this attempt to send the email. @@ -191,7 +177,6 @@ export interface EmailTry { message: string } - export interface DomainRecords { /** * DMARC TXT record specification. @@ -211,7 +196,6 @@ export interface DomainRecords { mx?: DomainRecordsMX } - export interface DomainReputation { /** * Status of your domain's reputation. @@ -235,7 +219,6 @@ export interface DomainReputation { previousScoredAt?: Date } - export interface DomainStatistics { totalCount: number sentCount: number @@ -243,7 +226,6 @@ export interface DomainStatistics { canceledCount: number } - export interface Blocklist { /** * ID of the blocklist. @@ -283,7 +265,6 @@ export interface Blocklist { custom: boolean } - export interface CreateEmailRequestAddress { /** * Email address. @@ -295,7 +276,6 @@ export interface CreateEmailRequestAddress { name?: string } - export interface CreateEmailRequestAttachment { /** * Filename of the attachment. @@ -311,7 +291,6 @@ export interface CreateEmailRequestAttachment { content: string } - export interface CreateEmailRequestHeader { /** * Email header key. @@ -323,7 +302,6 @@ export interface CreateEmailRequestHeader { value: string } - export interface Email { /** * Technical ID of the email. @@ -387,7 +365,6 @@ export interface Email { flags: EmailFlag[] } - export interface DomainLastStatusAutoconfigState { /** * Enable or disable the auto-configuration of domain DNS records. @@ -403,7 +380,6 @@ export interface DomainLastStatusAutoconfigState { reason?: DomainLastStatusAutoconfigStateReason } - export interface DomainLastStatusDkimRecord { /** * Status of the DKIM record's configuration. @@ -419,7 +395,6 @@ export interface DomainLastStatusDkimRecord { error?: string } - export interface DomainLastStatusDmarcRecord { /** * Status of the DMARC record's configuration. @@ -435,7 +410,6 @@ export interface DomainLastStatusDmarcRecord { error?: string } - export interface DomainLastStatusMXRecord { /** * Status of the MX record's configuration. This record is optional to validate a domain, but highly recommended. @@ -451,7 +425,6 @@ export interface DomainLastStatusMXRecord { error?: string } - export interface DomainLastStatusSpfRecord { /** * Status of the SPF record's configuration. @@ -467,7 +440,6 @@ export interface DomainLastStatusSpfRecord { error?: string } - export interface Domain { /** * ID of the domain. @@ -539,7 +511,6 @@ export interface Domain { region: ScwRegion } - export interface OfferSubscription { /** * ID of the offer-subscription Organization. @@ -587,7 +558,6 @@ export interface OfferSubscription { includedMonthlyEmails: number } - export interface Offer { /** * Name of the offer. @@ -627,7 +597,6 @@ export interface Offer { maxCustomBlocklistsPerDomain: number } - export interface Pool { /** * ID of the Project. @@ -655,7 +624,6 @@ export interface Pool { reverse?: string } - export interface WebhookEvent { /** * ID of the Webhook Event. @@ -703,7 +671,6 @@ export interface WebhookEvent { emailId?: string } - export interface Webhook { /** * ID of the Webhook. @@ -743,7 +710,6 @@ export interface Webhook { updatedAt?: Date } - export interface ProjectSettingsPeriodicReport { /** * Enable or disable periodic report notifications. @@ -763,7 +729,6 @@ export interface ProjectSettingsPeriodicReport { sendingDay: number } - export interface UpdateProjectSettingsRequestUpdatePeriodicReport { /** * (Optional) Enable or disable periodic report notifications. @@ -783,7 +748,6 @@ export interface UpdateProjectSettingsRequestUpdatePeriodicReport { sendingDay?: number } - export type BulkCreateBlocklistsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -807,7 +771,6 @@ export type BulkCreateBlocklistsRequest = { reason?: string } - export interface BulkCreateBlocklistsResponse { /** * List of blocklist created. @@ -815,7 +778,6 @@ export interface BulkCreateBlocklistsResponse { blocklists: Blocklist[] } - export type CancelEmailRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -827,7 +789,6 @@ export type CancelEmailRequest = { emailId: string } - export type CheckDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -839,7 +800,6 @@ export type CheckDomainRequest = { domainId: string } - export type CreateDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -863,7 +823,6 @@ export type CreateDomainRequest = { autoconfig: boolean } - export type CreateEmailRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -915,7 +874,6 @@ export type CreateEmailRequest = { additionalHeaders?: CreateEmailRequestHeader[] } - export interface CreateEmailResponse { /** * Single page of emails matching the requested criteria. @@ -923,7 +881,6 @@ export interface CreateEmailResponse { emails: Email[] } - export type CreateWebhookRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -951,7 +908,6 @@ export type CreateWebhookRequest = { snsArn: string } - export type DeleteBlocklistRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -963,7 +919,6 @@ export type DeleteBlocklistRequest = { blocklistId: string } - export type DeleteWebhookRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -975,7 +930,6 @@ export type DeleteWebhookRequest = { webhookId: string } - export interface DomainLastStatus { /** * The ID of the domain. @@ -1007,7 +961,6 @@ export interface DomainLastStatus { autoconfigState?: DomainLastStatusAutoconfigState } - export type GetDomainLastStatusRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1019,7 +972,6 @@ export type GetDomainLastStatusRequest = { domainId: string } - export type GetDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1031,7 +983,6 @@ export type GetDomainRequest = { domainId: string } - export type GetEmailRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1043,7 +994,6 @@ export type GetEmailRequest = { emailId: string } - export type GetProjectConsumptionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1055,7 +1005,6 @@ export type GetProjectConsumptionRequest = { projectId?: string } - export type GetProjectSettingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1067,7 +1016,6 @@ export type GetProjectSettingsRequest = { projectId?: string } - export type GetStatisticsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1095,7 +1043,6 @@ export type GetStatisticsRequest = { mailFrom?: string } - export type GetWebhookRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1107,7 +1054,6 @@ export type GetWebhookRequest = { webhookId: string } - export type ListBlocklistsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1143,7 +1089,6 @@ export type ListBlocklistsRequest = { custom?: boolean } - export interface ListBlocklistsResponse { /** * Number of blocklists matching the requested criteria. @@ -1155,7 +1100,6 @@ export interface ListBlocklistsResponse { blocklists: Blocklist[] } - export type ListDomainsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1187,7 +1131,6 @@ export type ListDomainsRequest = { name?: string } - export interface ListDomainsResponse { /** * Number of domains that match the request (without pagination). @@ -1199,7 +1142,6 @@ export interface ListDomainsResponse { domains: Domain[] } - export type ListEmailsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1261,7 +1203,6 @@ export type ListEmailsRequest = { flags?: EmailFlag[] } - export interface ListEmailsResponse { /** * Number of emails matching the requested criteria. @@ -1273,7 +1214,6 @@ export interface ListEmailsResponse { emails: Email[] } - export type ListOfferSubscriptionsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1285,7 +1225,6 @@ export type ListOfferSubscriptionsRequest = { projectId?: string } - export interface ListOfferSubscriptionsResponse { /** * Number of offer-subscriptions matching the requested criteria. @@ -1297,7 +1236,6 @@ export interface ListOfferSubscriptionsResponse { offerSubscriptions: OfferSubscription[] } - export type ListOffersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1305,7 +1243,6 @@ export type ListOffersRequest = { region?: ScwRegion } - export interface ListOffersResponse { /** * Number of offers matching the requested criteria. @@ -1317,7 +1254,6 @@ export interface ListOffersResponse { offers: Offer[] } - export type ListPoolsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1337,7 +1273,6 @@ export type ListPoolsRequest = { projectId?: string } - export interface ListPoolsResponse { /** * Number of pools matching the requested criteria. @@ -1349,7 +1284,6 @@ export interface ListPoolsResponse { pools: Pool[] } - export type ListWebhookEventsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1397,7 +1331,6 @@ export type ListWebhookEventsRequest = { domainId?: string } - export interface ListWebhookEventsResponse { /** * Number of Webhook events matching the requested criteria. @@ -1409,7 +1342,6 @@ export interface ListWebhookEventsResponse { webhookEvents: WebhookEvent[] } - export type ListWebhooksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1441,7 +1373,6 @@ export type ListWebhooksRequest = { domainId?: string } - export interface ListWebhooksResponse { /** * Number of Webhooks matching the requested criteria. @@ -1453,7 +1384,6 @@ export interface ListWebhooksResponse { webhooks: Webhook[] } - export interface ProjectConsumption { /** * ID of the project. @@ -1481,7 +1411,6 @@ export interface ProjectConsumption { customBlocklistsCount: number } - export interface ProjectSettings { /** * Information about your periodic report. @@ -1489,7 +1418,6 @@ export interface ProjectSettings { periodicReport?: ProjectSettingsPeriodicReport } - export type RevokeDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1501,7 +1429,6 @@ export type RevokeDomainRequest = { domainId: string } - export interface Statistics { /** * Total number of emails matching the requested criteria. @@ -1529,7 +1456,6 @@ export interface Statistics { canceledCount: number } - export type UpdateDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1545,7 +1471,6 @@ export type UpdateDomainRequest = { autoconfig?: boolean } - export type UpdateOfferSubscriptionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1561,7 +1486,6 @@ export type UpdateOfferSubscriptionRequest = { name?: OfferName } - export type UpdateProjectSettingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1577,7 +1501,6 @@ export type UpdateProjectSettingsRequest = { periodicReport?: UpdateProjectSettingsRequestUpdatePeriodicReport } - export type UpdateWebhookRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1600,5 +1523,3 @@ export type UpdateWebhookRequest = { */ snsArn?: string } - - diff --git a/packages_generated/test/src/v1/api.gen.ts b/packages_generated/test/src/v1/api.gen.ts index 818e534de..d96d48549 100644 --- a/packages_generated/test/src/v1/api.gen.ts +++ b/packages_generated/test/src/v1/api.gen.ts @@ -7,8 +7,8 @@ import { validatePathParam, waitForResource, } from '@scaleway/sdk-client' -import type { WaitForOptions, } from '@scaleway/sdk-client' -import {HUMAN_TRANSIENT_STATUSES as HUMAN_TRANSIENT_STATUSES_TEST,} from './content.gen.js' +import type { WaitForOptions } from '@scaleway/sdk-client' +import { HUMAN_TRANSIENT_STATUSES as HUMAN_TRANSIENT_STATUSES_TEST } from './content.gen.js' import { marshalCreateHumanRequest, unmarshalHuman, @@ -62,7 +62,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable unmarshalRegisterResponse, ) - protected pageOfListHumans = (request: Readonly = {}) => this.client.fetch( { @@ -72,13 +71,16 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListHumansResponse, ) - + /** * List all your humans. * @@ -88,7 +90,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable listHumans = (request: Readonly = {}) => enrichForPagination('humans', this.pageOfListHumans, request) - /** * Get human details. Get the human details associated with the given id. * @@ -103,7 +104,7 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable }, unmarshalHuman, ) - + /** * Waits for {@link Human} to be in a final state. * @@ -116,13 +117,14 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!HUMAN_TRANSIENT_STATUSES_TEST.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve(!HUMAN_TRANSIENT_STATUSES_TEST.includes(res.status))), this.getHuman, request, options, ) - /** * Create a new human. * @@ -142,7 +144,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable unmarshalHuman, ) - /** * Update an existing human. Update the human associated with the given id. * @@ -162,7 +163,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable unmarshalHuman, ) - /** * Delete an existing human. Delete the human associated with the given id. * @@ -178,7 +178,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable unmarshalHuman, ) - /** * Start a 1h running for the given human. Start a one hour running for the given human. * @@ -196,7 +195,6 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable unmarshalHuman, ) - /** * Make a human smoke. * @@ -214,7 +212,4 @@ Hint: you can use other test commands by setting the SCW_SECRET_KEY env variable }, unmarshalHuman, ) - - } - diff --git a/packages_generated/test/src/v1/content.gen.ts b/packages_generated/test/src/v1/content.gen.ts index 97b93f20f..c4e373c49 100644 --- a/packages_generated/test/src/v1/content.gen.ts +++ b/packages_generated/test/src/v1/content.gen.ts @@ -1,12 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - HumanStatus, -} from './types.gen.js' - +import type { HumanStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link HumanStatus}. */ -export const HUMAN_TRANSIENT_STATUSES: HumanStatus[] = [ - 'running', -] - +export const HUMAN_TRANSIENT_STATUSES: HumanStatus[] = ['running'] diff --git a/packages_generated/test/src/v1/index.gen.ts b/packages_generated/test/src/v1/index.gen.ts index 0c2d4f39d..dbf0d42a4 100644 --- a/packages_generated/test/src/v1/index.gen.ts +++ b/packages_generated/test/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/test/src/v1/marshalling.gen.ts b/packages_generated/test/src/v1/marshalling.gen.ts index bf1c15f43..66093f9e6 100644 --- a/packages_generated/test/src/v1/marshalling.gen.ts +++ b/packages_generated/test/src/v1/marshalling.gen.ts @@ -1,5 +1,9 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Human, @@ -36,7 +40,9 @@ export const unmarshalHuman = (data: unknown): Human => { } as Human } -export const unmarshalListHumansResponse = (data: unknown): ListHumansResponse => { +export const unmarshalListHumansResponse = ( + data: unknown, +): ListHumansResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListHumansResponse' failed as data isn't a dictionary.`, @@ -74,12 +80,16 @@ export const marshalCreateHumanRequest = ( height: request.height, is_happy: request.isHappy, name: request.name, - shoe_size: request.shoeSize, + shoe_size: request.shoeSize, ...resolveOneOf([ - {default: defaults.defaultProjectId,param: 'project_id', + { + default: defaults.defaultProjectId, + param: 'project_id', value: request.projectId, }, - {default: defaults.defaultOrganizationId,param: 'organization_id', + { + default: defaults.defaultOrganizationId, + param: 'organization_id', value: request.organizationId, }, ]), diff --git a/packages_generated/test/src/v1/types.gen.ts b/packages_generated/test/src/v1/types.gen.ts index 31ad6bafc..7022e31a1 100644 --- a/packages_generated/test/src/v1/types.gen.ts +++ b/packages_generated/test/src/v1/types.gen.ts @@ -1,6 +1,3 @@ - - - export type EyeColors = | 'unknown' | 'amber' @@ -12,10 +9,7 @@ export type EyeColors = | 'red' | 'violet' -export type HumanStatus = - | 'unknown' - | 'stopped' - | 'running' +export type HumanStatus = 'unknown' | 'stopped' | 'running' export type ListHumansRequestOrderBy = | 'created_at_asc' @@ -43,7 +37,6 @@ export interface Human { projectId: string } - export type CreateHumanRequest = { height: number shoeSize: number @@ -54,7 +47,7 @@ export type CreateHumanRequest = { isHappy: boolean eyesColor?: EyeColors /** - * @deprecated + * @deprecated * * One-of ('projectIdentifier'): at most one of 'projectId', 'organizationId' could be set. */ @@ -67,7 +60,6 @@ export type CreateHumanRequest = { projectId?: string } - export type DeleteHumanRequest = { /** * UUID of the human you want to delete. @@ -75,7 +67,6 @@ export type DeleteHumanRequest = { humanId: string } - export type GetHumanRequest = { /** * UUID of the human you want to get. @@ -83,7 +74,6 @@ export type GetHumanRequest = { humanId: string } - export type ListHumansRequest = { page?: number pageSize?: number @@ -92,24 +82,20 @@ export type ListHumansRequest = { projectId?: string } - export interface ListHumansResponse { totalCount: number humans: Human[] } - export type RegisterRequest = { username: string } - export interface RegisterResponse { secretKey: string accessKey: string } - export type RunHumanRequest = { /** * UUID of the human you want to make run. @@ -117,7 +103,6 @@ export type RunHumanRequest = { humanId: string } - export type SmokeHumanRequest = { /** * @deprecated UUID of the human you want to make smoking. @@ -125,7 +110,6 @@ export type SmokeHumanRequest = { humanId: string } - export type UpdateHumanRequest = { /** * UUID of the human you want to update. @@ -144,5 +128,3 @@ export type UpdateHumanRequest = { eyesColor?: EyeColors name?: string } - - diff --git a/packages_generated/vpc/src/v2/api.gen.ts b/packages_generated/vpc/src/v2/api.gen.ts index d2a478f79..2ad67a8de 100644 --- a/packages_generated/vpc/src/v2/api.gen.ts +++ b/packages_generated/vpc/src/v2/api.gen.ts @@ -7,7 +7,7 @@ import { validatePathParam, toApiLocality, } from '@scaleway/sdk-client' -import type { ApiLocality,} from '@scaleway/sdk-client' +import type { ApiLocality } from '@scaleway/sdk-client' import { marshalAddSubnetsRequest, unmarshalAddSubnetsResponse, @@ -78,15 +78,10 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + protected pageOfListVPCs = (request: Readonly = {}) => this.client.fetch( { @@ -98,7 +93,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['routing_enabled', request.routingEnabled], ['tags', request.tags], @@ -106,7 +104,7 @@ export class API extends ParentAPI { }, unmarshalListVPCsResponse, ) - + /** * List VPCs. List existing VPCs in the specified region. * @@ -116,7 +114,6 @@ export class API extends ParentAPI { listVPCs = (request: Readonly = {}) => enrichForPagination('vpcs', this.pageOfListVPCs, request) - /** * Create a VPC. Create a new VPC in the specified region. * @@ -136,7 +133,6 @@ export class API extends ParentAPI { unmarshalVPC, ) - /** * Get a VPC. Retrieve details of an existing VPC, specified by its VPC ID. * @@ -152,7 +148,6 @@ export class API extends ParentAPI { unmarshalVPC, ) - /** * Update VPC. Update parameters including name and tags of the specified VPC. * @@ -172,22 +167,20 @@ export class API extends ParentAPI { unmarshalVPC, ) - /** * Delete a VPC. Delete a VPC specified by its VPC ID. * * @param request - The request {@link DeleteVPCRequest} */ deleteVPC = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}`, + }) - - protected pageOfListPrivateNetworks = (request: Readonly = {}) => + protected pageOfListPrivateNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -198,7 +191,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['tags', request.tags], @@ -207,7 +203,7 @@ export class API extends ParentAPI { }, unmarshalListPrivateNetworksResponse, ) - + /** * List Private Networks. List existing Private Networks in the specified region. By default, the Private Networks returned in the list are ordered by creation date in ascending order, though this can be modified via the order_by field. * @@ -215,9 +211,12 @@ export class API extends ParentAPI { * @returns A Promise of ListPrivateNetworksResponse */ listPrivateNetworks = (request: Readonly = {}) => - enrichForPagination('privateNetworks', this.pageOfListPrivateNetworks, request) + enrichForPagination( + 'privateNetworks', + this.pageOfListPrivateNetworks, + request, + ) - /** * Create a Private Network. Create a new Private Network. Once created, you can attach Scaleway resources which are in the same region. * @@ -237,7 +236,6 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Get a Private Network. Retrieve information about an existing Private Network, specified by its Private Network ID. Its full details are returned in the response object. * @@ -253,7 +251,6 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Update Private Network. Update parameters (such as name or tags) of an existing Private Network, specified by its Private Network ID. * @@ -273,21 +270,17 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Delete a Private Network. Delete an existing Private Network. Note that you must first detach all resources from the network, in order to delete it. * * @param request - The request {@link DeletePrivateNetworkRequest} */ deletePrivateNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}`, + }) - /** * Enable DHCP on a Private Network. Enable DHCP managed on an existing Private Network. Note that you will not be able to deactivate it afterwards. * @@ -305,7 +298,6 @@ export class API extends ParentAPI { unmarshalPrivateNetwork, ) - /** * Enable routing on a VPC. Enable routing on an existing VPC. Note that you will not be able to deactivate it afterwards. * @@ -323,14 +315,15 @@ export class API extends ParentAPI { unmarshalVPC, ) - /** * Enable custom routes propagation on a VPC. Enable custom routes propagation on an existing VPC. Note that you will not be able to deactivate it afterwards. * * @param request - The request {@link EnableCustomRoutesPropagationRequest} * @returns A Promise of VPC */ - enableCustomRoutesPropagation = (request: Readonly) => + enableCustomRoutesPropagation = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -341,7 +334,6 @@ export class API extends ParentAPI { unmarshalVPC, ) - protected pageOfListSubnets = (request: Readonly = {}) => this.client.fetch( { @@ -351,7 +343,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['subnet_ids', request.subnetIds], ['vpc_id', request.vpcId], @@ -359,7 +354,7 @@ export class API extends ParentAPI { }, unmarshalListSubnetsResponse, ) - + /** * List subnets. List any Private Network's subnets. See ListPrivateNetworks to list a specific Private Network's subnets. * @@ -369,7 +364,6 @@ export class API extends ParentAPI { listSubnets = (request: Readonly = {}) => enrichForPagination('subnets', this.pageOfListSubnets, request) - /** * Add subnets to a Private Network. Add new subnets to an existing Private Network. * @@ -389,7 +383,6 @@ export class API extends ParentAPI { unmarshalAddSubnetsResponse, ) - /** * Delete subnets from a Private Network. Delete the specified subnets from a Private Network. * @@ -409,7 +402,6 @@ export class API extends ParentAPI { unmarshalDeleteSubnetsResponse, ) - /** * Create a Route. Create a new custom Route. * @@ -429,7 +421,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Get a Route. Retrieve details of an existing Route, specified by its Route ID. * @@ -445,7 +436,6 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Update Route. Update parameters of the specified Route. * @@ -465,21 +455,17 @@ export class API extends ParentAPI { unmarshalRoute, ) - /** * Delete a Route. Delete a Route specified by its Route ID. * * @param request - The request {@link DeleteRouteRequest} */ deleteRoute = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/routes/${validatePathParam('routeId', request.routeId)}`, + }) - /** * Get ACL Rules for VPC. Retrieve a list of ACL rules for a VPC, specified by its VPC ID. * @@ -491,14 +477,11 @@ export class API extends ParentAPI { { method: 'GET', path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/vpcs/${validatePathParam('vpcId', request.vpcId)}/acl-rules`, - urlParams: urlParams( - ['is_ipv6', request.isIpv6], - ), + urlParams: urlParams(['is_ipv6', request.isIpv6]), }, unmarshalGetAclResponse, ) - /** * Set VPC ACL rules. Set the list of ACL rules and the default routing policy for a VPC. * @@ -517,7 +500,4 @@ export class API extends ParentAPI { }, unmarshalSetAclResponse, ) - - } - diff --git a/packages_generated/vpc/src/v2/index.gen.ts b/packages_generated/vpc/src/v2/index.gen.ts index ac14d3f04..18e326881 100644 --- a/packages_generated/vpc/src/v2/index.gen.ts +++ b/packages_generated/vpc/src/v2/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './marshalling.gen.js' export type { AclRule, diff --git a/packages_generated/vpc/src/v2/marshalling.gen.ts b/packages_generated/vpc/src/v2/marshalling.gen.ts index 3d9b2b4c4..1ad0dd4ac 100644 --- a/packages_generated/vpc/src/v2/marshalling.gen.ts +++ b/packages_generated/vpc/src/v2/marshalling.gen.ts @@ -1,7 +1,11 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Subnet, @@ -114,7 +118,9 @@ export const unmarshalVPC = (data: unknown): VPC => { } as VPC } -export const unmarshalAddSubnetsResponse = (data: unknown): AddSubnetsResponse => { +export const unmarshalAddSubnetsResponse = ( + data: unknown, +): AddSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddSubnetsResponse' failed as data isn't a dictionary.`, @@ -126,7 +132,9 @@ export const unmarshalAddSubnetsResponse = (data: unknown): AddSubnetsResponse = } as AddSubnetsResponse } -export const unmarshalDeleteSubnetsResponse = (data: unknown): DeleteSubnetsResponse => { +export const unmarshalDeleteSubnetsResponse = ( + data: unknown, +): DeleteSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'DeleteSubnetsResponse' failed as data isn't a dictionary.`, @@ -171,7 +179,9 @@ export const unmarshalGetAclResponse = (data: unknown): GetAclResponse => { } as GetAclResponse } -export const unmarshalListPrivateNetworksResponse = (data: unknown): ListPrivateNetworksResponse => { +export const unmarshalListPrivateNetworksResponse = ( + data: unknown, +): ListPrivateNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPrivateNetworksResponse' failed as data isn't a dictionary.`, @@ -179,12 +189,17 @@ export const unmarshalListPrivateNetworksResponse = (data: unknown): ListPrivate } return { - privateNetworks: unmarshalArrayOfObject(data.private_networks, unmarshalPrivateNetwork), + privateNetworks: unmarshalArrayOfObject( + data.private_networks, + unmarshalPrivateNetwork, + ), totalCount: data.total_count, } as ListPrivateNetworksResponse } -export const unmarshalListSubnetsResponse = (data: unknown): ListSubnetsResponse => { +export const unmarshalListSubnetsResponse = ( + data: unknown, +): ListSubnetsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListSubnetsResponse' failed as data isn't a dictionary.`, @@ -292,7 +307,7 @@ export const marshalSetAclRequest = ( ): Record => ({ default_policy: request.defaultPolicy, is_ipv6: request.isIpv6, - rules: request.rules.map(elt => marshalAclRule(elt, defaults)), + rules: request.rules.map(elt => marshalAclRule(elt, defaults)), }) export const marshalUpdatePrivateNetworkRequest = ( diff --git a/packages_generated/vpc/src/v2/types.gen.ts b/packages_generated/vpc/src/v2/types.gen.ts index 06305997f..65a15e72d 100644 --- a/packages_generated/vpc/src/v2/types.gen.ts +++ b/packages_generated/vpc/src/v2/types.gen.ts @@ -1,18 +1,10 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Region as ScwRegion, } from '@scaleway/sdk-client' +import type { Region as ScwRegion } from '@scaleway/sdk-client' +export type AclRuleProtocol = 'ANY' | 'TCP' | 'UDP' | 'ICMP' -export type AclRuleProtocol = - | 'ANY' - | 'TCP' - | 'UDP' - | 'ICMP' - -export type Action = - | 'unknown_action' - | 'accept' - | 'drop' +export type Action = 'unknown_action' | 'accept' | 'drop' export type ListPrivateNetworksRequestOrderBy = | 'created_at_asc' @@ -20,9 +12,7 @@ export type ListPrivateNetworksRequestOrderBy = | 'name_asc' | 'name_desc' -export type ListSubnetsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListSubnetsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListVPCsRequestOrderBy = | 'created_at_asc' @@ -69,7 +59,6 @@ export interface Subnet { vpcId: string } - export interface PrivateNetwork { /** * Private Network ID. @@ -121,7 +110,6 @@ export interface PrivateNetwork { defaultRoutePropagationEnabled: boolean } - export interface Route { /** * Route ID. @@ -173,7 +161,6 @@ export interface Route { region: ScwRegion } - export interface AclRule { /** * Protocol to which this rule applies. @@ -213,7 +200,6 @@ export interface AclRule { description?: string } - export interface VPC { /** * VPC ID. @@ -265,7 +251,6 @@ export interface VPC { customRoutesPropagationEnabled: boolean } - export type AddSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -281,12 +266,10 @@ export type AddSubnetsRequest = { subnets?: string[] } - export interface AddSubnetsResponse { subnets: string[] } - export type CreatePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -318,7 +301,6 @@ export type CreatePrivateNetworkRequest = { defaultRoutePropagationEnabled: boolean } - export type CreateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -350,7 +332,6 @@ export type CreateRouteRequest = { nexthopPrivateNetworkId?: string } - export type CreateVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -374,7 +355,6 @@ export type CreateVPCRequest = { enableRouting: boolean } - export type DeletePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -386,7 +366,6 @@ export type DeletePrivateNetworkRequest = { privateNetworkId: string } - export type DeleteRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -398,7 +377,6 @@ export type DeleteRouteRequest = { routeId: string } - export type DeleteSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -414,12 +392,10 @@ export type DeleteSubnetsRequest = { subnets?: string[] } - export interface DeleteSubnetsResponse { subnets: string[] } - export type DeleteVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -431,7 +407,6 @@ export type DeleteVPCRequest = { vpcId: string } - export type EnableCustomRoutesPropagationRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -443,7 +418,6 @@ export type EnableCustomRoutesPropagationRequest = { vpcId: string } - export type EnableDHCPRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -455,7 +429,6 @@ export type EnableDHCPRequest = { privateNetworkId: string } - export type EnableRoutingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -467,7 +440,6 @@ export type EnableRoutingRequest = { vpcId: string } - export type GetAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -483,13 +455,11 @@ export type GetAclRequest = { isIpv6: boolean } - export interface GetAclResponse { rules: AclRule[] defaultPolicy: Action } - export type GetPrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -501,7 +471,6 @@ export type GetPrivateNetworkRequest = { privateNetworkId: string } - export type GetRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -513,7 +482,6 @@ export type GetRouteRequest = { routeId: string } - export type GetVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -525,7 +493,6 @@ export type GetVPCRequest = { vpcId: string } - export type ListPrivateNetworksRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -573,13 +540,11 @@ export type ListPrivateNetworksRequest = { dhcpEnabled?: boolean } - export interface ListPrivateNetworksResponse { privateNetworks: PrivateNetwork[] totalCount: number } - export type ListSubnetsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -615,13 +580,11 @@ export type ListSubnetsRequest = { vpcId?: string } - export interface ListSubnetsResponse { subnets: Subnet[] totalCount: number } - export type ListVPCsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -665,13 +628,11 @@ export type ListVPCsRequest = { routingEnabled?: boolean } - export interface ListVPCsResponse { vpcs: VPC[] totalCount: number } - export type SetAclRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -695,13 +656,11 @@ export type SetAclRequest = { defaultPolicy: Action } - export interface SetAclResponse { rules: AclRule[] defaultPolicy: Action } - export type UpdatePrivateNetworkRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -725,7 +684,6 @@ export type UpdatePrivateNetworkRequest = { defaultRoutePropagationEnabled?: boolean } - export type UpdateRouteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -757,7 +715,6 @@ export type UpdateRouteRequest = { nexthopPrivateNetworkId?: string } - export type UpdateVPCRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -776,5 +733,3 @@ export type UpdateVPCRequest = { */ tags?: string[] } - - diff --git a/packages_generated/vpcgw/src/v1/api.gen.ts b/packages_generated/vpcgw/src/v1/api.gen.ts index a89c83861..69d9109c2 100644 --- a/packages_generated/vpcgw/src/v1/api.gen.ts +++ b/packages_generated/vpcgw/src/v1/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {GATEWAY_NETWORK_TRANSIENT_STATUSES as GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW,GATEWAY_TRANSIENT_STATUSES as GATEWAY_TRANSIENT_STATUSES_VPCGW,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + GATEWAY_NETWORK_TRANSIENT_STATUSES as GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW, + GATEWAY_TRANSIENT_STATUSES as GATEWAY_TRANSIENT_STATUSES_VPCGW, +} from './content.gen.js' import { marshalCreateDHCPEntryRequest, marshalCreateDHCPRequest, @@ -111,21 +114,22 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - - protected pageOfListGateways = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + + protected pageOfListGateways = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -135,7 +139,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['project_id', request.projectId], ['status', request.status], @@ -145,7 +152,7 @@ export class API extends ParentAPI { }, unmarshalListGatewaysResponse, ) - + /** * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date. * @@ -156,7 +163,6 @@ export class API extends ParentAPI { listGateways = (request: Readonly = {}) => enrichForPagination('gateways', this.pageOfListGateways, request) - /** * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more. * @@ -172,7 +178,7 @@ export class API extends ParentAPI { }, unmarshalGateway, ) - + /** * Waits for {@link Gateway} to be in a final state. * @@ -185,13 +191,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES_VPCGW.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !GATEWAY_TRANSIENT_STATUSES_VPCGW.includes(res.status), + )), this.getGateway, request, options, ) - /** * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion. * @@ -212,7 +221,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**. * @@ -233,7 +241,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible. * @@ -241,17 +248,12 @@ export class API extends ParentAPI { * @param request - The request {@link DeleteGatewayRequest} */ deleteGateway = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`, - urlParams: urlParams( - ['cleanup_dhcp', request.cleanupDhcp], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`, + urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp]), + }) - /** * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update. * @@ -272,7 +274,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Upgrade a Public Gateway to IP mobility. Upgrade a Public Gateway to IP mobility (move from NAT IP to routed IP). This is idempotent: repeated calls after the first will return no error but have no effect. * @@ -280,17 +281,16 @@ export class API extends ParentAPI { * @param request - The request {@link EnableIPMobilityRequest} */ enableIPMobility = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/enable-ip-mobility`, - }, - ) + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/enable-ip-mobility`, + }) - - protected pageOfListGatewayNetworks = (request: Readonly = {}) => + protected pageOfListGatewayNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -301,14 +301,17 @@ export class API extends ParentAPI { ['gateway_id', request.gatewayId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_id', request.privateNetworkId], ['status', request.status], ), }, unmarshalListGatewayNetworksResponse, ) - + /** * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network. * @@ -317,9 +320,12 @@ export class API extends ParentAPI { * @returns A Promise of ListGatewayNetworksResponse */ listGatewayNetworks = (request: Readonly = {}) => - enrichForPagination('gatewayNetworks', this.pageOfListGatewayNetworks, request) + enrichForPagination( + 'gatewayNetworks', + this.pageOfListGatewayNetworks, + request, + ) - /** * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings. * @@ -335,7 +341,7 @@ export class API extends ParentAPI { }, unmarshalGatewayNetwork, ) - + /** * Waits for {@link GatewayNetwork} to be in a final state. * @@ -348,13 +354,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW.includes(res.status), + )), this.getGatewayNetwork, request, options, ) - /** * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including DHCP settings, whether to enable masquerade (dynamic NAT), and more. * @@ -375,7 +384,6 @@ export class API extends ParentAPI { unmarshalGatewayNetwork, ) - /** * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include DHCP settings and whether to enable traffic masquerade (dynamic NAT). * @@ -396,7 +404,6 @@ export class API extends ParentAPI { unmarshalGatewayNetwork, ) - /** * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id. * @@ -404,17 +411,12 @@ export class API extends ParentAPI { * @param request - The request {@link DeleteGatewayNetworkRequest} */ deleteGatewayNetwork = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`, - urlParams: urlParams( - ['cleanup_dhcp', request.cleanupDhcp], - ), - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateway-networks/${validatePathParam('gatewayNetworkId', request.gatewayNetworkId)}`, + urlParams: urlParams(['cleanup_dhcp', request.cleanupDhcp]), + }) - protected pageOfListDHCPs = (request: Readonly = {}) => this.client.fetch( { @@ -426,13 +428,16 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ), }, unmarshalListDHCPsResponse, ) - + /** * List DHCP configurations. List DHCP configurations, optionally filtering by Organization, Project, Public Gateway IP address or more. The response is an array of DHCP configuration objects, each identified by a DHCP ID and containing configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID. * @@ -443,7 +448,6 @@ export class API extends ParentAPI { listDHCPs = (request: Readonly = {}) => enrichForPagination('dhcps', this.pageOfListDHCPs, request) - /** * Get a DHCP configuration. Get a DHCP configuration object, identified by its DHCP ID. The response object contains configuration settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. Note that the response does not contain the IDs of any Private Network / Public Gateway the configuration is attached to. Use the `List Public Gateway connections to Private Networks` method for that purpose, filtering on DHCP ID. * @@ -460,7 +464,6 @@ export class API extends ParentAPI { unmarshalDHCP, ) - /** * Create a DHCP configuration. Create a new DHCP configuration object, containing settings for the assignment of IP addresses to devices on a Private Network attached to a Public Gateway. The response object includes the ID of the DHCP configuration object. You can use this ID as part of a call to `Create a Public Gateway connection to a Private Network` or `Update a Public Gateway connection to a Private Network` to directly apply this DHCP configuration. * @@ -481,7 +484,6 @@ export class API extends ParentAPI { unmarshalDHCP, ) - /** * Update a DHCP configuration. Update a DHCP configuration object, identified by its DHCP ID. * @@ -502,7 +504,6 @@ export class API extends ParentAPI { unmarshalDHCP, ) - /** * Delete a DHCP configuration. Delete a DHCP configuration object, identified by its DHCP ID. Note that you cannot delete a DHCP configuration object that is currently being used by a Gateway Network. * @@ -510,15 +511,14 @@ export class API extends ParentAPI { * @param request - The request {@link DeleteDHCPRequest} */ deleteDHCP = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcps/${validatePathParam('dhcpId', request.dhcpId)}`, + }) - - protected pageOfListDHCPEntries = (request: Readonly = {}) => + protected pageOfListDHCPEntries = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -530,13 +530,16 @@ export class API extends ParentAPI { ['mac_address', request.macAddress], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['type', request.type], ), }, unmarshalListDHCPEntriesResponse, ) - + /** * List DHCP entries. List DHCP entries, whether dynamically assigned and/or statically reserved. DHCP entries can be filtered by the Gateway Network they are on, their MAC address, IP address, type or hostname. * @@ -547,7 +550,6 @@ export class API extends ParentAPI { listDHCPEntries = (request: Readonly = {}) => enrichForPagination('dhcpEntries', this.pageOfListDHCPEntries, request) - /** * Get a DHCP entry. Get a DHCP entry, specified by its DHCP entry ID. * @@ -564,7 +566,6 @@ export class API extends ParentAPI { unmarshalDHCPEntry, ) - /** * Create a DHCP entry. Create a static DHCP reservation, specifying the Gateway Network for the reservation, the MAC address of the target device and the IP address to assign this device. The response is a DHCP entry object, confirming the ID and configuration details of the static DHCP reservation. * @@ -585,7 +586,6 @@ export class API extends ParentAPI { unmarshalDHCPEntry, ) - /** * Update a DHCP entry. Update the IP address for a DHCP entry, specified by its DHCP entry ID. You can update an existing DHCP entry of any type (`reservation` (static), `lease` (dynamic) or `unknown`), but in manually updating the IP address the entry will necessarily be of type `reservation` after the update. * @@ -606,7 +606,6 @@ export class API extends ParentAPI { unmarshalDHCPEntry, ) - /** * Set all DHCP reservations on a Gateway Network. Set the list of DHCP reservations attached to a Gateway Network. Reservations are identified by their MAC address, and will sync the current DHCP entry list to the given list, creating, updating or deleting DHCP entries accordingly. * @@ -627,7 +626,6 @@ export class API extends ParentAPI { unmarshalSetDHCPEntriesResponse, ) - /** * Delete a DHCP entry. Delete a static DHCP reservation, identified by its DHCP entry ID. Note that you cannot delete DHCP entries of type `lease`, these are deleted automatically when their time-to-live expires. * @@ -635,15 +633,14 @@ export class API extends ParentAPI { * @param request - The request {@link DeleteDHCPEntryRequest} */ deleteDHCPEntry = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/dhcp-entries/${validatePathParam('dhcpEntryId', request.dhcpEntryId)}`, + }) - - protected pageOfListPATRules = (request: Readonly = {}) => + protected pageOfListPATRules = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -652,14 +649,17 @@ export class API extends ParentAPI { ['gateway_id', request.gatewayId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_ip', request.privateIp], ['protocol', request.protocol], ), }, unmarshalListPATRulesResponse, ) - + /** * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol. * @@ -670,7 +670,6 @@ export class API extends ParentAPI { listPATRules = (request: Readonly = {}) => enrichForPagination('patRules', this.pageOfListPATRules, request) - /** * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol. * @@ -687,7 +686,6 @@ export class API extends ParentAPI { unmarshalPATRule, ) - /** * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to. * @@ -708,7 +706,6 @@ export class API extends ParentAPI { unmarshalPATRule, ) - /** * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated. * @@ -729,7 +726,6 @@ export class API extends ParentAPI { unmarshalPATRule, ) - /** * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly. * @@ -750,7 +746,6 @@ export class API extends ParentAPI { unmarshalSetPATRulesResponse, ) - /** * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible. * @@ -758,14 +753,11 @@ export class API extends ParentAPI { * @param request - The request {@link DeletePATRuleRequest} */ deletePATRule = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`, + }) - /** * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type. * @@ -782,7 +774,6 @@ export class API extends ParentAPI { unmarshalListGatewayTypesResponse, ) - protected pageOfListIPs = (request: Readonly = {}) => this.client.fetch( { @@ -793,7 +784,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags], @@ -801,7 +795,7 @@ export class API extends ParentAPI { }, unmarshalListIPsResponse, ) - + /** * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response. * @@ -812,7 +806,6 @@ export class API extends ParentAPI { listIPs = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIPs, request) - /** * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata. * @@ -829,7 +822,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project. * @@ -850,7 +842,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to. * @@ -871,7 +862,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Delete an IP. Delete a flexible IP address from your account. This action is irreversible. * @@ -879,14 +869,11 @@ export class API extends ParentAPI { * @param request - The request {@link DeleteIPRequest} */ deleteIP = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, + }) - /** * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself. * @@ -905,7 +892,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Put a Public Gateway in IPAM mode. Put a Public Gateway in IPAM mode, so that it can be used with the Public Gateways API v2. This call is idempotent. * @@ -913,15 +899,10 @@ export class API extends ParentAPI { * @param request - The request {@link MigrateToV2Request} */ migrateToV2 = (request: Readonly) => - this.client.fetch( - { - body: '{}', - headers: jsonContentHeaders, - method: 'POST', - path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/migrate-to-v2`, - }, - ) - - + this.client.fetch({ + body: '{}', + headers: jsonContentHeaders, + method: 'POST', + path: `/vpc-gw/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/migrate-to-v2`, + }) } - diff --git a/packages_generated/vpcgw/src/v1/content.gen.ts b/packages_generated/vpcgw/src/v1/content.gen.ts index a6dd21e09..1a02cadc5 100644 --- a/packages_generated/vpcgw/src/v1/content.gen.ts +++ b/packages_generated/vpcgw/src/v1/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - GatewayNetworkStatus, - GatewayStatus, -} from './types.gen.js' - +import type { GatewayNetworkStatus, GatewayStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */ export const GATEWAY_NETWORK_TRANSIENT_STATUSES: GatewayNetworkStatus[] = [ @@ -20,4 +16,3 @@ export const GATEWAY_TRANSIENT_STATUSES: GatewayStatus[] = [ 'stopping', 'deleting', ] - diff --git a/packages_generated/vpcgw/src/v1/index.gen.ts b/packages_generated/vpcgw/src/v1/index.gen.ts index 06a5e9b9d..2752190d5 100644 --- a/packages_generated/vpcgw/src/v1/index.gen.ts +++ b/packages_generated/vpcgw/src/v1/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/vpcgw/src/v1/marshalling.gen.ts b/packages_generated/vpcgw/src/v1/marshalling.gen.ts index ffd05fc09..bf2aadb59 100644 --- a/packages_generated/vpcgw/src/v1/marshalling.gen.ts +++ b/packages_generated/vpcgw/src/v1/marshalling.gen.ts @@ -1,7 +1,12 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { DHCP, @@ -100,7 +105,9 @@ export const unmarshalGatewayNetwork = (data: unknown): GatewayNetwork => { enableMasquerade: data.enable_masquerade, gatewayId: data.gateway_id, id: data.id, - ipamConfig: data.ipam_config ? unmarshalIpamConfig(data.ipam_config) : undefined, + ipamConfig: data.ipam_config + ? unmarshalIpamConfig(data.ipam_config) + : undefined, macAddress: data.mac_address, privateNetworkId: data.private_network_id, status: data.status, @@ -176,7 +183,10 @@ export const unmarshalGateway = (data: unknown): Gateway => { bastionPort: data.bastion_port, canUpgradeTo: data.can_upgrade_to, createdAt: unmarshalDate(data.created_at), - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), + gatewayNetworks: unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork, + ), id: data.id, ip: data.ip ? unmarshalIP(data.ip) : undefined, ipMobilityEnabled: data.ip_mobility_enabled, @@ -215,7 +225,9 @@ export const unmarshalPATRule = (data: unknown): PATRule => { } as PATRule } -export const unmarshalListDHCPEntriesResponse = (data: unknown): ListDHCPEntriesResponse => { +export const unmarshalListDHCPEntriesResponse = ( + data: unknown, +): ListDHCPEntriesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDHCPEntriesResponse' failed as data isn't a dictionary.`, @@ -228,7 +240,9 @@ export const unmarshalListDHCPEntriesResponse = (data: unknown): ListDHCPEntries } as ListDHCPEntriesResponse } -export const unmarshalListDHCPsResponse = (data: unknown): ListDHCPsResponse => { +export const unmarshalListDHCPsResponse = ( + data: unknown, +): ListDHCPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDHCPsResponse' failed as data isn't a dictionary.`, @@ -241,7 +255,9 @@ export const unmarshalListDHCPsResponse = (data: unknown): ListDHCPsResponse => } as ListDHCPsResponse } -export const unmarshalListGatewayNetworksResponse = (data: unknown): ListGatewayNetworksResponse => { +export const unmarshalListGatewayNetworksResponse = ( + data: unknown, +): ListGatewayNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`, @@ -249,12 +265,17 @@ export const unmarshalListGatewayNetworksResponse = (data: unknown): ListGateway } return { - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), + gatewayNetworks: unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork, + ), totalCount: data.total_count, } as ListGatewayNetworksResponse } -export const unmarshalListGatewayTypesResponse = (data: unknown): ListGatewayTypesResponse => { +export const unmarshalListGatewayTypesResponse = ( + data: unknown, +): ListGatewayTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`, @@ -266,7 +287,9 @@ export const unmarshalListGatewayTypesResponse = (data: unknown): ListGatewayTyp } as ListGatewayTypesResponse } -export const unmarshalListGatewaysResponse = (data: unknown): ListGatewaysResponse => { +export const unmarshalListGatewaysResponse = ( + data: unknown, +): ListGatewaysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`, @@ -292,7 +315,9 @@ export const unmarshalListIPsResponse = (data: unknown): ListIPsResponse => { } as ListIPsResponse } -export const unmarshalListPATRulesResponse = (data: unknown): ListPATRulesResponse => { +export const unmarshalListPATRulesResponse = ( + data: unknown, +): ListPATRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPATRulesResponse' failed as data isn't a dictionary.`, @@ -305,7 +330,9 @@ export const unmarshalListPATRulesResponse = (data: unknown): ListPATRulesRespon } as ListPATRulesResponse } -export const unmarshalSetDHCPEntriesResponse = (data: unknown): SetDHCPEntriesResponse => { +export const unmarshalSetDHCPEntriesResponse = ( + data: unknown, +): SetDHCPEntriesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetDHCPEntriesResponse' failed as data isn't a dictionary.`, @@ -317,7 +344,9 @@ export const unmarshalSetDHCPEntriesResponse = (data: unknown): SetDHCPEntriesRe } as SetDHCPEntriesResponse } -export const unmarshalSetPATRulesResponse = (data: unknown): SetPATRulesResponse => { +export const unmarshalSetPATRulesResponse = ( + data: unknown, +): SetPATRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPATRulesResponse' failed as data isn't a dictionary.`, @@ -373,21 +402,26 @@ export const marshalCreateGatewayNetworkRequest = ( enable_dhcp: request.enableDhcp, enable_masquerade: request.enableMasquerade, gateway_id: request.gatewayId, - private_network_id: request.privateNetworkId, + private_network_id: request.privateNetworkId, ...resolveOneOf>([ - {param: 'dhcp_id', - value: request.dhcpId, - }, - {param: 'dhcp', - value: (request.dhcp !== undefined) ? marshalCreateDHCPRequest(request.dhcp, defaults) - : undefined, + { param: 'dhcp_id', value: request.dhcpId }, + { + param: 'dhcp', + value: + request.dhcp !== undefined + ? marshalCreateDHCPRequest(request.dhcp, defaults) + : undefined, }, - {param: 'address', - value: request.address, - }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalCreateGatewayNetworkRequestIpamConfig(request.ipamConfig, defaults) - : undefined, + { param: 'address', value: request.address }, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalCreateGatewayNetworkRequestIpamConfig( + request.ipamConfig, + defaults, + ) + : undefined, }, ]), }) @@ -438,7 +472,12 @@ export const marshalSetDHCPEntriesRequest = ( request: SetDHCPEntriesRequest, defaults: DefaultValues, ): Record => ({ - dhcp_entries: ((request.dhcpEntries !== undefined) ? request.dhcpEntries.map(elt => marshalSetDHCPEntriesRequestEntry(elt, defaults)): undefined), + dhcp_entries: + request.dhcpEntries !== undefined + ? request.dhcpEntries.map(elt => + marshalSetDHCPEntriesRequestEntry(elt, defaults), + ) + : undefined, gateway_network_id: request.gatewayNetworkId, }) @@ -457,7 +496,9 @@ export const marshalSetPATRulesRequest = ( defaults: DefaultValues, ): Record => ({ gateway_id: request.gatewayId, - pat_rules: request.patRules.map(elt => marshalSetPATRulesRequestRule(elt, defaults)), + pat_rules: request.patRules.map(elt => + marshalSetPATRulesRequestRule(elt, defaults), + ), }) export const marshalUpdateDHCPEntryRequest = ( @@ -499,17 +540,19 @@ export const marshalUpdateGatewayNetworkRequest = ( defaults: DefaultValues, ): Record => ({ enable_dhcp: request.enableDhcp, - enable_masquerade: request.enableMasquerade, + enable_masquerade: request.enableMasquerade, ...resolveOneOf>([ - {param: 'dhcp_id', - value: request.dhcpId, - }, - {param: 'address', - value: request.address, - }, - {param: 'ipam_config', - value: (request.ipamConfig !== undefined) ? marshalUpdateGatewayNetworkRequestIpamConfig(request.ipamConfig, defaults) - : undefined, + { param: 'dhcp_id', value: request.dhcpId }, + { param: 'address', value: request.address }, + { + param: 'ipam_config', + value: + request.ipamConfig !== undefined + ? marshalUpdateGatewayNetworkRequestIpamConfig( + request.ipamConfig, + defaults, + ) + : undefined, }, ]), }) diff --git a/packages_generated/vpcgw/src/v1/types.gen.ts b/packages_generated/vpcgw/src/v1/types.gen.ts index 3fb910f5e..d22cd20e8 100644 --- a/packages_generated/vpcgw/src/v1/types.gen.ts +++ b/packages_generated/vpcgw/src/v1/types.gen.ts @@ -1,12 +1,8 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' +import type { Zone as ScwZone } from '@scaleway/sdk-client' - -export type DHCPEntryType = - | 'unknown' - | 'reservation' - | 'lease' +export type DHCPEntryType = 'unknown' | 'reservation' | 'lease' export type GatewayNetworkStatus = | 'unknown' @@ -73,11 +69,7 @@ export type ListPATRulesRequestOrderBy = | 'public_port_asc' | 'public_port_desc' -export type PATRuleProtocol = - | 'unknown' - | 'both' - | 'tcp' - | 'udp' +export type PATRuleProtocol = 'unknown' | 'both' | 'tcp' | 'udp' export interface DHCP { /** @@ -158,7 +150,6 @@ export interface DHCP { zone: ScwZone } - export interface IpamConfig { /** * Defines whether the default route is enabled on that Gateway Network. @@ -170,7 +161,6 @@ export interface IpamConfig { ipamIpId: string } - export interface GatewayNetwork { /** * ID of the Public Gateway-Private Network connection. @@ -226,7 +216,6 @@ export interface GatewayNetwork { zone: ScwZone } - export interface GatewayType { /** * Public Gateway type name. @@ -242,7 +231,6 @@ export interface GatewayType { zone: ScwZone } - export interface IP { /** * IP address ID. @@ -286,7 +274,6 @@ export interface IP { zone: ScwZone } - export type CreateDHCPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -350,7 +337,6 @@ export type CreateDHCPRequest = { dnsLocalName?: string } - export interface CreateGatewayNetworkRequestIpamConfig { /** * Enabling the default route also enables masquerading. @@ -362,7 +348,6 @@ export interface CreateGatewayNetworkRequestIpamConfig { ipamIpId?: string } - export interface DHCPEntry { /** * DHCP entry ID. @@ -402,7 +387,6 @@ export interface DHCPEntry { zone: ScwZone } - export interface Gateway { /** * ID of the gateway. @@ -486,7 +470,6 @@ export interface Gateway { zone: ScwZone } - export interface PATRule { /** * PAT rule ID. @@ -526,7 +509,6 @@ export interface PATRule { zone: ScwZone } - export interface SetDHCPEntriesRequestEntry { /** * MAC address to give a static entry to. A matching entry will be upgraded to a reservation, and a matching reservation will be updated. @@ -538,7 +520,6 @@ export interface SetDHCPEntriesRequestEntry { ipAddress: string } - export interface SetPATRulesRequestRule { /** * Public port to listen on. Uniquely identifies the rule, and a matching rule will be updated with the new parameters. @@ -558,7 +539,6 @@ export interface SetPATRulesRequestRule { protocol: PATRuleProtocol } - export interface UpdateGatewayNetworkRequestIpamConfig { /** * Enabling the default route also enables masquerading. @@ -570,7 +550,6 @@ export interface UpdateGatewayNetworkRequestIpamConfig { ipamIpId?: string } - export type CreateDHCPEntryRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -590,7 +569,6 @@ export type CreateDHCPEntryRequest = { ipAddress: string } - export type CreateGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -639,7 +617,6 @@ Note: this setting is ignored when passing `ipam_config`. ipamConfig?: CreateGatewayNetworkRequestIpamConfig } - export type CreateGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -683,7 +660,6 @@ export type CreateGatewayRequest = { bastionPort?: number } - export type CreateIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -699,7 +675,6 @@ export type CreateIPRequest = { tags?: string[] } - export type CreatePATRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -727,7 +702,6 @@ export type CreatePATRuleRequest = { protocol?: PATRuleProtocol } - export type DeleteDHCPEntryRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -739,7 +713,6 @@ export type DeleteDHCPEntryRequest = { dhcpEntryId: string } - export type DeleteDHCPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -751,7 +724,6 @@ export type DeleteDHCPRequest = { dhcpId: string } - export type DeleteGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -767,7 +739,6 @@ export type DeleteGatewayNetworkRequest = { cleanupDhcp: boolean } - export type DeleteGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -783,7 +754,6 @@ export type DeleteGatewayRequest = { cleanupDhcp: boolean } - export type DeleteIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -795,7 +765,6 @@ export type DeleteIPRequest = { ipId: string } - export type DeletePATRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -807,7 +776,6 @@ export type DeletePATRuleRequest = { patRuleId: string } - export type EnableIPMobilityRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -819,7 +787,6 @@ export type EnableIPMobilityRequest = { gatewayId: string } - export type GetDHCPEntryRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -831,7 +798,6 @@ export type GetDHCPEntryRequest = { dhcpEntryId: string } - export type GetDHCPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -843,7 +809,6 @@ export type GetDHCPRequest = { dhcpId: string } - export type GetGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -855,7 +820,6 @@ export type GetGatewayNetworkRequest = { gatewayNetworkId: string } - export type GetGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -867,7 +831,6 @@ export type GetGatewayRequest = { gatewayId: string } - export type GetIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -879,7 +842,6 @@ export type GetIPRequest = { ipId: string } - export type GetPATRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -891,7 +853,6 @@ export type GetPATRuleRequest = { patRuleId: string } - export type ListDHCPEntriesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -931,7 +892,6 @@ export type ListDHCPEntriesRequest = { type?: DHCPEntryType } - export interface ListDHCPEntriesResponse { /** * DHCP entries in this page. @@ -943,7 +903,6 @@ export interface ListDHCPEntriesResponse { totalCount: number } - export type ListDHCPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -979,7 +938,6 @@ export type ListDHCPsRequest = { hasAddress?: string } - export interface ListDHCPsResponse { /** * First page of DHCP configuration objects. @@ -991,7 +949,6 @@ export interface ListDHCPsResponse { totalCount: number } - export type ListGatewayNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1031,7 +988,6 @@ export type ListGatewayNetworksRequest = { status?: GatewayNetworkStatus } - export interface ListGatewayNetworksResponse { /** * GatewayNetworks on this page. @@ -1043,7 +999,6 @@ export interface ListGatewayNetworksResponse { totalCount: number } - export type ListGatewayTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1051,7 +1006,6 @@ export type ListGatewayTypesRequest = { zone?: ScwZone } - export interface ListGatewayTypesResponse { /** * Available types of Public Gateway. @@ -1059,7 +1013,6 @@ export interface ListGatewayTypesResponse { types: GatewayType[] } - export type ListGatewaysRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1107,7 +1060,6 @@ export type ListGatewaysRequest = { privateNetworkId?: string } - export interface ListGatewaysResponse { /** * Gateways on this page. @@ -1119,7 +1071,6 @@ export interface ListGatewaysResponse { totalCount: number } - export type ListIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1159,7 +1110,6 @@ export type ListIPsRequest = { isFree?: boolean } - export interface ListIPsResponse { /** * IP addresses on this page. @@ -1171,7 +1121,6 @@ export interface ListIPsResponse { totalCount: number } - export type ListPATRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1203,7 +1152,6 @@ export type ListPATRulesRequest = { protocol?: PATRuleProtocol } - export interface ListPATRulesResponse { /** * Array of PAT rules matching the filter. @@ -1215,7 +1163,6 @@ export interface ListPATRulesResponse { totalCount: number } - export type MigrateToV2Request = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1227,7 +1174,6 @@ export type MigrateToV2Request = { gatewayId: string } - export type RefreshSSHKeysRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1239,7 +1185,6 @@ export type RefreshSSHKeysRequest = { gatewayId: string } - export type SetDHCPEntriesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1255,7 +1200,6 @@ export type SetDHCPEntriesRequest = { dhcpEntries?: SetDHCPEntriesRequestEntry[] } - export interface SetDHCPEntriesResponse { /** * List of DHCP entries. @@ -1263,7 +1207,6 @@ export interface SetDHCPEntriesResponse { dhcpEntries: DHCPEntry[] } - export type SetPATRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1279,7 +1222,6 @@ export type SetPATRulesRequest = { patRules: SetPATRulesRequestRule[] } - export interface SetPATRulesResponse { /** * List of PAT rules. @@ -1287,7 +1229,6 @@ export interface SetPATRulesResponse { patRules: PATRule[] } - export type UpdateDHCPEntryRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1303,7 +1244,6 @@ export type UpdateDHCPEntryRequest = { ipAddress?: string } - export type UpdateDHCPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1367,7 +1307,6 @@ export type UpdateDHCPRequest = { dnsLocalName?: string } - export type UpdateGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1406,7 +1345,6 @@ Note: this setting is ignored when passing `ipam_config`. ipamConfig?: UpdateGatewayNetworkRequestIpamConfig } - export type UpdateGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1442,7 +1380,6 @@ export type UpdateGatewayRequest = { enableSmtp?: boolean } - export type UpdateIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1466,7 +1403,6 @@ export type UpdateIPRequest = { gatewayId?: string } - export type UpdatePATRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1494,7 +1430,6 @@ export type UpdatePATRuleRequest = { protocol?: PATRuleProtocol } - export type UpgradeGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -1509,5 +1444,3 @@ export type UpgradeGatewayRequest = { */ type?: string } - - diff --git a/packages_generated/vpcgw/src/v2/api.gen.ts b/packages_generated/vpcgw/src/v2/api.gen.ts index 23b68bd8c..71b6b75a4 100644 --- a/packages_generated/vpcgw/src/v2/api.gen.ts +++ b/packages_generated/vpcgw/src/v2/api.gen.ts @@ -8,8 +8,11 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {GATEWAY_NETWORK_TRANSIENT_STATUSES as GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW,GATEWAY_TRANSIENT_STATUSES as GATEWAY_TRANSIENT_STATUSES_VPCGW,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + GATEWAY_NETWORK_TRANSIENT_STATUSES as GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW, + GATEWAY_TRANSIENT_STATUSES as GATEWAY_TRANSIENT_STATUSES_VPCGW, +} from './content.gen.js' import { marshalAddBastionAllowedIPsRequest, unmarshalAddBastionAllowedIPsResponse, @@ -92,21 +95,22 @@ export class API extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - zones: [ - 'fr-par-1', - 'fr-par-2', - 'nl-ams-1', - 'nl-ams-2', - 'nl-ams-3', - 'pl-waw-1', - 'pl-waw-2', - 'pl-waw-3', - ], - }) - - protected pageOfListGateways = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + zones: [ + 'fr-par-1', + 'fr-par-2', + 'nl-ams-1', + 'nl-ams-2', + 'nl-ams-3', + 'pl-waw-1', + 'pl-waw-2', + 'pl-waw-3', + ], + }) + + protected pageOfListGateways = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -117,7 +121,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_ids', request.privateNetworkIds], ['project_id', request.projectId], ['status', request.status], @@ -127,7 +134,7 @@ export class API extends ParentAPI { }, unmarshalListGatewaysResponse, ) - + /** * List Public Gateways. List Public Gateways in a given Scaleway Organization or Project. By default, results are displayed in ascending order of creation date. * @@ -137,7 +144,6 @@ export class API extends ParentAPI { listGateways = (request: Readonly = {}) => enrichForPagination('gateways', this.pageOfListGateways, request) - /** * Get a Public Gateway. Get details of a Public Gateway, specified by its gateway ID. The response object contains full details of the gateway, including its **name**, **type**, **status** and more. * @@ -152,7 +158,7 @@ export class API extends ParentAPI { }, unmarshalGateway, ) - + /** * Waits for {@link Gateway} to be in a final state. * @@ -165,13 +171,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!GATEWAY_TRANSIENT_STATUSES_VPCGW.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !GATEWAY_TRANSIENT_STATUSES_VPCGW.includes(res.status), + )), this.getGateway, request, options, ) - /** * Create a Public Gateway. Create a new Public Gateway in the specified Scaleway Project, defining its **name**, **type** and other configuration details such as whether to enable SSH bastion. * @@ -191,7 +200,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Update a Public Gateway. Update the parameters of an existing Public Gateway, for example, its **name**, **tags**, **SSH bastion configuration**, and **DNS servers**. * @@ -211,7 +219,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Delete a Public Gateway. Delete an existing Public Gateway, specified by its gateway ID. This action is irreversible. * @@ -223,14 +230,11 @@ export class API extends ParentAPI { { method: 'DELETE', path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}`, - urlParams: urlParams( - ['delete_ip', request.deleteIp], - ), + urlParams: urlParams(['delete_ip', request.deleteIp]), }, unmarshalGateway, ) - /** * Upgrade a Public Gateway to the latest version and/or to a different commercial offer type. Upgrade a given Public Gateway to the newest software version or to a different commercial offer type. This applies the latest bugfixes and features to your Public Gateway. Note that gateway service will be interrupted during the update. * @@ -250,8 +254,9 @@ export class API extends ParentAPI { unmarshalGateway, ) - - protected pageOfListGatewayNetworks = (request: Readonly = {}) => + protected pageOfListGatewayNetworks = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -261,14 +266,17 @@ export class API extends ParentAPI { ['masquerade_enabled', request.masqueradeEnabled], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_network_ids', request.privateNetworkIds], ['status', request.status], ), }, unmarshalListGatewayNetworksResponse, ) - + /** * List Public Gateway connections to Private Networks. List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network. * @@ -276,9 +284,12 @@ export class API extends ParentAPI { * @returns A Promise of ListGatewayNetworksResponse */ listGatewayNetworks = (request: Readonly = {}) => - enrichForPagination('gatewayNetworks', this.pageOfListGatewayNetworks, request) + enrichForPagination( + 'gatewayNetworks', + this.pageOfListGatewayNetworks, + request, + ) - /** * Get a Public Gateway connection to a Private Network. Get details of a given connection between a Public Gateway and a Private Network (this connection = a GatewayNetwork), specified by its `gateway_network_id`. The response object contains details of the connection including the IDs of the Public Gateway and Private Network, the dates the connection was created/updated and its configuration settings. * @@ -293,7 +304,7 @@ export class API extends ParentAPI { }, unmarshalGatewayNetwork, ) - + /** * Waits for {@link GatewayNetwork} to be in a final state. * @@ -306,13 +317,16 @@ export class API extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !GATEWAY_NETWORK_TRANSIENT_STATUSES_VPCGW.includes(res.status), + )), this.getGatewayNetwork, request, options, ) - /** * Attach a Public Gateway to a Private Network. Attach a specific Public Gateway to a specific Private Network (create a GatewayNetwork). You can configure parameters for the connection including whether to enable masquerade (dynamic NAT), and more. * @@ -332,7 +346,6 @@ export class API extends ParentAPI { unmarshalGatewayNetwork, ) - /** * Update a Public Gateway's connection to a Private Network. Update the configuration parameters of a connection between a given Public Gateway and Private Network (the connection = a GatewayNetwork). Updatable parameters include whether to enable traffic masquerade (dynamic NAT). * @@ -352,7 +365,6 @@ export class API extends ParentAPI { unmarshalGatewayNetwork, ) - /** * Detach a Public Gateway from a Private Network. Detach a given Public Gateway from a given Private Network, i.e. delete a GatewayNetwork specified by a gateway_network_id. * @@ -368,8 +380,9 @@ export class API extends ParentAPI { unmarshalGatewayNetwork, ) - - protected pageOfListPatRules = (request: Readonly = {}) => + protected pageOfListPatRules = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -378,14 +391,17 @@ export class API extends ParentAPI { ['gateway_ids', request.gatewayIds], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['private_ips', request.privateIps], ['protocol', request.protocol], ), }, unmarshalListPatRulesResponse, ) - + /** * List PAT rules. List PAT rules. You can filter by gateway ID to list all PAT rules for a particular gateway, or filter for PAT rules targeting a specific IP address or using a specific protocol. * @@ -395,7 +411,6 @@ export class API extends ParentAPI { listPatRules = (request: Readonly = {}) => enrichForPagination('patRules', this.pageOfListPatRules, request) - /** * Get a PAT rule. Get a PAT rule, specified by its PAT rule ID. The response object gives full details of the PAT rule, including the Public Gateway it belongs to and the configuration settings in terms of public / private ports, private IP and protocol. * @@ -411,7 +426,6 @@ export class API extends ParentAPI { unmarshalPatRule, ) - /** * Create a PAT rule. Create a new PAT rule on a specified Public Gateway, defining the protocol to use, public port to listen on, and private port / IP address to map to. * @@ -431,7 +445,6 @@ export class API extends ParentAPI { unmarshalPatRule, ) - /** * Update a PAT rule. Update a PAT rule, specified by its PAT rule ID. Configuration settings including private/public port, private IP address and protocol can all be updated. * @@ -451,7 +464,6 @@ export class API extends ParentAPI { unmarshalPatRule, ) - /** * Set all PAT rules. Set a definitive list of PAT rules attached to a Public Gateway. Each rule is identified by its public port and protocol. This will sync the current PAT rule list on the gateway with the new list, creating, updating or deleting PAT rules accordingly. * @@ -471,21 +483,17 @@ export class API extends ParentAPI { unmarshalSetPatRulesResponse, ) - /** * Delete a PAT rule. Delete a PAT rule, identified by its PAT rule ID. This action is irreversible. * * @param request - The request {@link DeletePatRuleRequest} */ deletePatRule = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/pat-rules/${validatePathParam('patRuleId', request.patRuleId)}`, + }) - /** * List Public Gateway types. List the different Public Gateway commercial offer types available at Scaleway. The response is an array of objects describing the name and technical details of each available gateway type. * @@ -501,7 +509,6 @@ export class API extends ParentAPI { unmarshalListGatewayTypesResponse, ) - protected pageOfListIPs = (request: Readonly = {}) => this.client.fetch( { @@ -512,7 +519,10 @@ export class API extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['reverse', request.reverse], ['tags', request.tags], @@ -520,7 +530,7 @@ export class API extends ParentAPI { }, unmarshalListIPsResponse, ) - + /** * List IPs. List Public Gateway flexible IP addresses. A number of filter options are available for limiting results in the response. * @@ -530,7 +540,6 @@ export class API extends ParentAPI { listIPs = (request: Readonly = {}) => enrichForPagination('ips', this.pageOfListIPs, request) - /** * Get an IP. Get details of a Public Gateway flexible IP address, identified by its IP ID. The response object contains information including which (if any) Public Gateway using this IP address, the reverse and various other metadata. * @@ -546,7 +555,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Reserve an IP. Create (reserve) a new flexible IP address that can be used for a Public Gateway in a specified Scaleway Project. * @@ -566,7 +574,6 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Update an IP. Update details of an existing flexible IP address, including its tags, reverse and the Public Gateway it is assigned to. * @@ -586,21 +593,17 @@ export class API extends ParentAPI { unmarshalIP, ) - /** * Delete an IP. Delete a flexible IP address from your account. This action is irreversible. * * @param request - The request {@link DeleteIPRequest} */ deleteIP = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, - }, - ) + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/ips/${validatePathParam('ipId', request.ipId)}`, + }) - /** * Refresh a Public Gateway's SSH keys. Refresh the SSH keys of a given Public Gateway, specified by its gateway ID. This adds any new SSH keys in the gateway's Scaleway Project to the gateway itself. * @@ -618,7 +621,6 @@ export class API extends ParentAPI { unmarshalGateway, ) - /** * Add allowed IP range to SSH bastion. Add an IP range (in CIDR notation) to be allowed to connect to the SSH bastion. * @@ -638,7 +640,6 @@ export class API extends ParentAPI { unmarshalAddBastionAllowedIPsResponse, ) - /** * Set all IP ranges allowed for SSH bastion. Set a definitive list of IP ranges (in CIDR notation) allowed to connect to the SSH bastion. * @@ -658,20 +659,16 @@ export class API extends ParentAPI { unmarshalSetBastionAllowedIPsResponse, ) - /** * Delete allowed IP range from SSH bastion. Delete an IP range (defined in CIDR notation) from SSH bastion, so that it is no longer allowed to connect. * * @param request - The request {@link DeleteBastionAllowedIPsRequest} */ - deleteBastionAllowedIPs = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/bastion-allowed-ips/${validatePathParam('ipRange', request.ipRange)}`, - }, - ) - - + deleteBastionAllowedIPs = ( + request: Readonly, + ) => + this.client.fetch({ + method: 'DELETE', + path: `/vpc-gw/v2/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/gateways/${validatePathParam('gatewayId', request.gatewayId)}/bastion-allowed-ips/${validatePathParam('ipRange', request.ipRange)}`, + }) } - diff --git a/packages_generated/vpcgw/src/v2/content.gen.ts b/packages_generated/vpcgw/src/v2/content.gen.ts index a6dd21e09..1a02cadc5 100644 --- a/packages_generated/vpcgw/src/v2/content.gen.ts +++ b/packages_generated/vpcgw/src/v2/content.gen.ts @@ -1,10 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { - GatewayNetworkStatus, - GatewayStatus, -} from './types.gen.js' - +import type { GatewayNetworkStatus, GatewayStatus } from './types.gen.js' /** Lists transient statutes of the enum {@link GatewayNetworkStatus}. */ export const GATEWAY_NETWORK_TRANSIENT_STATUSES: GatewayNetworkStatus[] = [ @@ -20,4 +16,3 @@ export const GATEWAY_TRANSIENT_STATUSES: GatewayStatus[] = [ 'stopping', 'deleting', ] - diff --git a/packages_generated/vpcgw/src/v2/index.gen.ts b/packages_generated/vpcgw/src/v2/index.gen.ts index 567b9995f..4c9cb80a3 100644 --- a/packages_generated/vpcgw/src/v2/index.gen.ts +++ b/packages_generated/vpcgw/src/v2/index.gen.ts @@ -1,8 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -export { - API, -} from './api.gen.js' +export { API } from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { diff --git a/packages_generated/vpcgw/src/v2/marshalling.gen.ts b/packages_generated/vpcgw/src/v2/marshalling.gen.ts index 0949cfd9a..c9943ec89 100644 --- a/packages_generated/vpcgw/src/v2/marshalling.gen.ts +++ b/packages_generated/vpcgw/src/v2/marshalling.gen.ts @@ -1,7 +1,11 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. import randomName from '@scaleway/random-name' -import { isJSONObject, unmarshalArrayOfObject, unmarshalDate, } from '@scaleway/sdk-client' +import { + isJSONObject, + unmarshalArrayOfObject, + unmarshalDate, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { GatewayNetwork, @@ -89,7 +93,10 @@ export const unmarshalGateway = (data: unknown): Gateway => { bastionPort: data.bastion_port, canUpgradeTo: data.can_upgrade_to, createdAt: unmarshalDate(data.created_at), - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), + gatewayNetworks: unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork, + ), id: data.id, ipv4: data.ipv4 ? unmarshalIP(data.ipv4) : undefined, isLegacy: data.is_legacy, @@ -126,7 +133,9 @@ export const unmarshalPatRule = (data: unknown): PatRule => { } as PatRule } -export const unmarshalAddBastionAllowedIPsResponse = (data: unknown): AddBastionAllowedIPsResponse => { +export const unmarshalAddBastionAllowedIPsResponse = ( + data: unknown, +): AddBastionAllowedIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'AddBastionAllowedIPsResponse' failed as data isn't a dictionary.`, @@ -138,7 +147,9 @@ export const unmarshalAddBastionAllowedIPsResponse = (data: unknown): AddBastion } as AddBastionAllowedIPsResponse } -export const unmarshalListGatewayNetworksResponse = (data: unknown): ListGatewayNetworksResponse => { +export const unmarshalListGatewayNetworksResponse = ( + data: unknown, +): ListGatewayNetworksResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewayNetworksResponse' failed as data isn't a dictionary.`, @@ -146,7 +157,10 @@ export const unmarshalListGatewayNetworksResponse = (data: unknown): ListGateway } return { - gatewayNetworks: unmarshalArrayOfObject(data.gateway_networks, unmarshalGatewayNetwork), + gatewayNetworks: unmarshalArrayOfObject( + data.gateway_networks, + unmarshalGatewayNetwork, + ), totalCount: data.total_count, } as ListGatewayNetworksResponse } @@ -165,7 +179,9 @@ const unmarshalGatewayType = (data: unknown): GatewayType => { } as GatewayType } -export const unmarshalListGatewayTypesResponse = (data: unknown): ListGatewayTypesResponse => { +export const unmarshalListGatewayTypesResponse = ( + data: unknown, +): ListGatewayTypesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewayTypesResponse' failed as data isn't a dictionary.`, @@ -177,7 +193,9 @@ export const unmarshalListGatewayTypesResponse = (data: unknown): ListGatewayTyp } as ListGatewayTypesResponse } -export const unmarshalListGatewaysResponse = (data: unknown): ListGatewaysResponse => { +export const unmarshalListGatewaysResponse = ( + data: unknown, +): ListGatewaysResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListGatewaysResponse' failed as data isn't a dictionary.`, @@ -203,7 +221,9 @@ export const unmarshalListIPsResponse = (data: unknown): ListIPsResponse => { } as ListIPsResponse } -export const unmarshalListPatRulesResponse = (data: unknown): ListPatRulesResponse => { +export const unmarshalListPatRulesResponse = ( + data: unknown, +): ListPatRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListPatRulesResponse' failed as data isn't a dictionary.`, @@ -216,7 +236,9 @@ export const unmarshalListPatRulesResponse = (data: unknown): ListPatRulesRespon } as ListPatRulesResponse } -export const unmarshalSetBastionAllowedIPsResponse = (data: unknown): SetBastionAllowedIPsResponse => { +export const unmarshalSetBastionAllowedIPsResponse = ( + data: unknown, +): SetBastionAllowedIPsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetBastionAllowedIPsResponse' failed as data isn't a dictionary.`, @@ -228,7 +250,9 @@ export const unmarshalSetBastionAllowedIPsResponse = (data: unknown): SetBastion } as SetBastionAllowedIPsResponse } -export const unmarshalSetPatRulesResponse = (data: unknown): SetPatRulesResponse => { +export const unmarshalSetPatRulesResponse = ( + data: unknown, +): SetPatRulesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SetPatRulesResponse' failed as data isn't a dictionary.`, @@ -313,7 +337,9 @@ export const marshalSetPatRulesRequest = ( defaults: DefaultValues, ): Record => ({ gateway_id: request.gatewayId, - pat_rules: request.patRules.map(elt => marshalSetPatRulesRequestRule(elt, defaults)), + pat_rules: request.patRules.map(elt => + marshalSetPatRulesRequestRule(elt, defaults), + ), }) export const marshalUpdateGatewayNetworkRequest = ( diff --git a/packages_generated/vpcgw/src/v2/types.gen.ts b/packages_generated/vpcgw/src/v2/types.gen.ts index 564b7b7f2..4f604a89c 100644 --- a/packages_generated/vpcgw/src/v2/types.gen.ts +++ b/packages_generated/vpcgw/src/v2/types.gen.ts @@ -1,7 +1,6 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Zone as ScwZone} from '@scaleway/sdk-client' - +import type { Zone as ScwZone } from '@scaleway/sdk-client' export type GatewayNetworkStatus = | 'unknown_status' @@ -52,11 +51,7 @@ export type ListPatRulesRequestOrderBy = | 'public_port_asc' | 'public_port_desc' -export type PatRuleProtocol = - | 'unknown_protocol' - | 'both' - | 'tcp' - | 'udp' +export type PatRuleProtocol = 'unknown_protocol' | 'both' | 'tcp' | 'udp' export interface GatewayNetwork { /** @@ -105,7 +100,6 @@ export interface GatewayNetwork { zone: ScwZone } - export interface IP { /** * IP address ID. @@ -149,7 +143,6 @@ export interface IP { zone: ScwZone } - export interface GatewayType { /** * Public Gateway type name. @@ -165,7 +158,6 @@ export interface GatewayType { zone: ScwZone } - export interface Gateway { /** * ID of the gateway. @@ -249,7 +241,6 @@ export interface Gateway { zone: ScwZone } - export interface PatRule { /** * PAT rule ID. @@ -289,7 +280,6 @@ export interface PatRule { zone: ScwZone } - export interface SetPatRulesRequestRule { /** * Public port to listen on. Uniquely identifies the rule, and a matching rule will be updated with the new parameters. @@ -309,7 +299,6 @@ export interface SetPatRulesRequestRule { protocol: PatRuleProtocol } - export type AddBastionAllowedIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -325,7 +314,6 @@ export type AddBastionAllowedIPsRequest = { ipRange: string } - export interface AddBastionAllowedIPsResponse { /** * Ranges of IP addresses allowed to connect to the gateway's SSH bastion. @@ -333,7 +321,6 @@ export interface AddBastionAllowedIPsResponse { ipRanges: string[] } - export type CreateGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -361,7 +348,6 @@ export type CreateGatewayNetworkRequest = { ipamIpId?: string } - export type CreateGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -401,7 +387,6 @@ export type CreateGatewayRequest = { bastionPort?: number } - export type CreateIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -417,7 +402,6 @@ export type CreateIPRequest = { tags?: string[] } - export type CreatePatRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -445,7 +429,6 @@ export type CreatePatRuleRequest = { protocol?: PatRuleProtocol } - export type DeleteBastionAllowedIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -461,7 +444,6 @@ export type DeleteBastionAllowedIPsRequest = { ipRange: string } - export type DeleteGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -473,7 +455,6 @@ export type DeleteGatewayNetworkRequest = { gatewayNetworkId: string } - export type DeleteGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -489,7 +470,6 @@ export type DeleteGatewayRequest = { deleteIp: boolean } - export type DeleteIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -501,7 +481,6 @@ export type DeleteIPRequest = { ipId: string } - export type DeletePatRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -513,7 +492,6 @@ export type DeletePatRuleRequest = { patRuleId: string } - export type GetGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -525,7 +503,6 @@ export type GetGatewayNetworkRequest = { gatewayNetworkId: string } - export type GetGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -537,7 +514,6 @@ export type GetGatewayRequest = { gatewayId: string } - export type GetIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -549,7 +525,6 @@ export type GetIPRequest = { ipId: string } - export type GetPatRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -561,7 +536,6 @@ export type GetPatRuleRequest = { patRuleId: string } - export type ListGatewayNetworksRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -597,7 +571,6 @@ export type ListGatewayNetworksRequest = { masqueradeEnabled?: boolean } - export interface ListGatewayNetworksResponse { /** * GatewayNetworks on this page. @@ -609,7 +582,6 @@ export interface ListGatewayNetworksResponse { totalCount: number } - export type ListGatewayTypesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -617,7 +589,6 @@ export type ListGatewayTypesRequest = { zone?: ScwZone } - export interface ListGatewayTypesResponse { /** * Available types of Public Gateway. @@ -625,7 +596,6 @@ export interface ListGatewayTypesResponse { types: GatewayType[] } - export type ListGatewaysRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -677,7 +647,6 @@ export type ListGatewaysRequest = { includeLegacy?: boolean } - export interface ListGatewaysResponse { /** * Gateways on this page. @@ -689,7 +658,6 @@ export interface ListGatewaysResponse { totalCount: number } - export type ListIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -729,7 +697,6 @@ export type ListIPsRequest = { isFree?: boolean } - export interface ListIPsResponse { /** * IP addresses on this page. @@ -741,7 +708,6 @@ export interface ListIPsResponse { totalCount: number } - export type ListPatRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -773,7 +739,6 @@ export type ListPatRulesRequest = { protocol?: PatRuleProtocol } - export interface ListPatRulesResponse { /** * Array of PAT rules matching the filter. @@ -785,7 +750,6 @@ export interface ListPatRulesResponse { totalCount: number } - export type RefreshSSHKeysRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -797,7 +761,6 @@ export type RefreshSSHKeysRequest = { gatewayId: string } - export type SetBastionAllowedIPsRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -813,7 +776,6 @@ export type SetBastionAllowedIPsRequest = { ipRanges?: string[] } - export interface SetBastionAllowedIPsResponse { /** * Ranges of IP addresses allowed to connect to the gateway's SSH bastion. @@ -821,7 +783,6 @@ export interface SetBastionAllowedIPsResponse { ipRanges: string[] } - export type SetPatRulesRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -837,7 +798,6 @@ export type SetPatRulesRequest = { patRules: SetPatRulesRequestRule[] } - export interface SetPatRulesResponse { /** * List of PAT rules. @@ -845,7 +805,6 @@ export interface SetPatRulesResponse { patRules: PatRule[] } - export type UpdateGatewayNetworkRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -869,7 +828,6 @@ export type UpdateGatewayNetworkRequest = { ipamIpId?: string } - export type UpdateGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -901,7 +859,6 @@ export type UpdateGatewayRequest = { enableSmtp?: boolean } - export type UpdateIPRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -925,7 +882,6 @@ export type UpdateIPRequest = { gatewayId?: string } - export type UpdatePatRuleRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -953,7 +909,6 @@ export type UpdatePatRuleRequest = { protocol?: PatRuleProtocol } - export type UpgradeGatewayRequest = { /** * Zone to target. If none is passed will use default zone from the config. @@ -968,5 +923,3 @@ export type UpgradeGatewayRequest = { */ type?: string } - - diff --git a/packages_generated/webhosting/src/v1/api.gen.ts b/packages_generated/webhosting/src/v1/api.gen.ts index 233402090..a2d037413 100644 --- a/packages_generated/webhosting/src/v1/api.gen.ts +++ b/packages_generated/webhosting/src/v1/api.gen.ts @@ -8,8 +8,12 @@ import { waitForResource, toApiLocality, } from '@scaleway/sdk-client' -import type { WaitForOptions, ApiLocality,} from '@scaleway/sdk-client' -import {BACKUP_TRANSIENT_STATUSES as BACKUP_TRANSIENT_STATUSES_WEBHOSTING,DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_WEBHOSTING,HOSTING_TRANSIENT_STATUSES as HOSTING_TRANSIENT_STATUSES_WEBHOSTING,} from './content.gen.js' +import type { WaitForOptions, ApiLocality } from '@scaleway/sdk-client' +import { + BACKUP_TRANSIENT_STATUSES as BACKUP_TRANSIENT_STATUSES_WEBHOSTING, + DOMAIN_TRANSIENT_STATUSES as DOMAIN_TRANSIENT_STATUSES_WEBHOSTING, + HOSTING_TRANSIENT_STATUSES as HOSTING_TRANSIENT_STATUSES_WEBHOSTING, +} from './content.gen.js' import { unmarshalBackup, marshalBackupApiRestoreBackupItemsRequest, @@ -33,7 +37,6 @@ import { unmarshalHosting, marshalHostingApiAddCustomDomainRequest, marshalHostingApiCreateHostingRequest, - marshalHostingApiMigrateControlPanelRequest, marshalHostingApiRemoveCustomDomainRequest, marshalHostingApiUpdateHostingRequest, unmarshalHostingSummary, @@ -110,7 +113,6 @@ import type { HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, - HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, @@ -160,16 +162,13 @@ export class BackupAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListBackups = (request: Readonly) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListBackups = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -177,12 +176,15 @@ export class BackupAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListBackupsResponse, ) - + /** * List all available backups for a hosting account.. List all available backups for a hosting account. * @@ -192,7 +194,6 @@ export class BackupAPI extends ParentAPI { listBackups = (request: Readonly) => enrichForPagination('backups', this.pageOfListBackups, request) - /** * Get info about a backup specified by the backup ID.. Get info about a backup specified by the backup ID. * @@ -207,7 +208,7 @@ export class BackupAPI extends ParentAPI { }, unmarshalBackup, ) - + /** * Waits for {@link Backup} to be in a final state. * @@ -220,13 +221,16 @@ export class BackupAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!BACKUP_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !BACKUP_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status), + )), this.getBackup, request, options, ) - /** * Restore an entire backup to your hosting environment.. Restore an entire backup to your hosting environment. * @@ -244,7 +248,6 @@ export class BackupAPI extends ParentAPI { unmarshalRestoreBackupResponse, ) - /** * List items within a specific backup, grouped by type.. List items within a specific backup, grouped by type. * @@ -256,25 +259,27 @@ export class BackupAPI extends ParentAPI { { method: 'GET', path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/backup-items`, - urlParams: urlParams( - ['backup_id', request.backupId], - ), + urlParams: urlParams(['backup_id', request.backupId]), }, unmarshalListBackupItemsResponse, ) - /** * Restore specific items from a backup (e.g., a database or mailbox).. Restore specific items from a backup (e.g., a database or mailbox). * * @param request - The request {@link BackupApiRestoreBackupItemsRequest} * @returns A Promise of RestoreBackupItemsResponse */ - restoreBackupItems = (request: Readonly) => + restoreBackupItems = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalBackupApiRestoreBackupItemsRequest(request, this.client.settings), + marshalBackupApiRestoreBackupItemsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -283,7 +288,6 @@ export class BackupAPI extends ParentAPI { unmarshalRestoreBackupItemsResponse, ) - /** * Retrieve detailed information about a specific progress by its ID.. Retrieve detailed information about a specific progress by its ID. * @@ -299,14 +303,15 @@ export class BackupAPI extends ParentAPI { unmarshalProgress, ) - /** * List recent progresses associated with a specific backup, grouped by type.. List recent progresses associated with a specific backup, grouped by type. * * @param request - The request {@link BackupApiListRecentProgressesRequest} * @returns A Promise of ListRecentProgressesResponse */ - listRecentProgresses = (request: Readonly) => + listRecentProgresses = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -314,8 +319,6 @@ export class BackupAPI extends ParentAPI { }, unmarshalListRecentProgressesResponse, ) - - } /** @@ -328,38 +331,38 @@ export class ControlPanelAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListControlPanels = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListControlPanels = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/control-panels`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListControlPanelsResponse, ) - + /** * "List the control panels type: cpanel or plesk.". * * @param request - The request {@link ControlPanelApiListControlPanelsRequest} * @returns A Promise of ListControlPanelsResponse */ - listControlPanels = (request: Readonly = {}) => + listControlPanels = ( + request: Readonly = {}, + ) => enrichForPagination('controlPanels', this.pageOfListControlPanels, request) - - } /** @@ -372,15 +375,10 @@ export class DatabaseAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * "Create a new database within your hosting plan". * @@ -391,7 +389,10 @@ export class DatabaseAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalDatabaseApiCreateDatabaseRequest(request, this.client.settings), + marshalDatabaseApiCreateDatabaseRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -400,8 +401,9 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabase, ) - - protected pageOfListDatabases = (request: Readonly) => + protected pageOfListDatabases = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -409,12 +411,15 @@ export class DatabaseAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDatabasesResponse, ) - + /** * "List all databases within your hosting plan". * @@ -424,7 +429,6 @@ export class DatabaseAPI extends ParentAPI { listDatabases = (request: Readonly) => enrichForPagination('databases', this.pageOfListDatabases, request) - /** * "Get details of a database within your hosting plan". * @@ -440,7 +444,6 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabase, ) - /** * "Delete a database within your hosting plan". * @@ -456,18 +459,22 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabase, ) - /** * "Create a new database user". * * @param request - The request {@link DatabaseApiCreateDatabaseUserRequest} * @returns A Promise of DatabaseUser */ - createDatabaseUser = (request: Readonly) => + createDatabaseUser = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalDatabaseApiCreateDatabaseUserRequest(request, this.client.settings), + marshalDatabaseApiCreateDatabaseUserRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -476,8 +483,9 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabaseUser, ) - - protected pageOfListDatabaseUsers = (request: Readonly) => + protected pageOfListDatabaseUsers = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -485,22 +493,25 @@ export class DatabaseAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListDatabaseUsersResponse, ) - + /** * "List all database users". * * @param request - The request {@link DatabaseApiListDatabaseUsersRequest} * @returns A Promise of ListDatabaseUsersResponse */ - listDatabaseUsers = (request: Readonly) => - enrichForPagination('users', this.pageOfListDatabaseUsers, request) + listDatabaseUsers = ( + request: Readonly, + ) => enrichForPagination('users', this.pageOfListDatabaseUsers, request) - /** * "Get details of a database user". * @@ -516,14 +527,15 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabaseUser, ) - /** * "Delete a database user". * * @param request - The request {@link DatabaseApiDeleteDatabaseUserRequest} * @returns A Promise of DatabaseUser */ - deleteDatabaseUser = (request: Readonly) => + deleteDatabaseUser = ( + request: Readonly, + ) => this.client.fetch( { method: 'DELETE', @@ -532,18 +544,22 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabaseUser, ) - /** * "Change the password of a database user". * * @param request - The request {@link DatabaseApiChangeDatabaseUserPasswordRequest} * @returns A Promise of DatabaseUser */ - changeDatabaseUserPassword = (request: Readonly) => + changeDatabaseUserPassword = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalDatabaseApiChangeDatabaseUserPasswordRequest(request, this.client.settings), + marshalDatabaseApiChangeDatabaseUserPasswordRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -552,18 +568,22 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabaseUser, ) - /** * "Assign a database user to a database". * * @param request - The request {@link DatabaseApiAssignDatabaseUserRequest} * @returns A Promise of DatabaseUser */ - assignDatabaseUser = (request: Readonly) => + assignDatabaseUser = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalDatabaseApiAssignDatabaseUserRequest(request, this.client.settings), + marshalDatabaseApiAssignDatabaseUserRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -572,18 +592,22 @@ export class DatabaseAPI extends ParentAPI { unmarshalDatabaseUser, ) - /** * "Unassign a database user from a database". * * @param request - The request {@link DatabaseApiUnassignDatabaseUserRequest} * @returns A Promise of DatabaseUser */ - unassignDatabaseUser = (request: Readonly) => + unassignDatabaseUser = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalDatabaseApiUnassignDatabaseUserRequest(request, this.client.settings), + marshalDatabaseApiUnassignDatabaseUserRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -591,8 +615,6 @@ export class DatabaseAPI extends ParentAPI { }, unmarshalDatabaseUser, ) - - } /** @@ -605,15 +627,10 @@ export class DnsAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Get DNS records. Get the set of DNS records of a specified domain associated with a Web Hosting plan's domain. * @@ -629,7 +646,6 @@ export class DnsAPI extends ParentAPI { unmarshalDnsRecords, ) - /** * Check whether you own this domain or not.. Check whether you own this domain or not. * @@ -641,7 +657,10 @@ export class DnsAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalDnsApiCheckUserOwnsDomainRequest(request, this.client.settings), + marshalDnsApiCheckUserOwnsDomainRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -650,18 +669,22 @@ export class DnsAPI extends ParentAPI { unmarshalCheckUserOwnsDomainResponse, ) - /** * Synchronize your DNS records on the Elements Console and on cPanel.. Synchronize your DNS records on the Elements Console and on cPanel. * * @param request - The request {@link DnsApiSyncDomainDnsRecordsRequest} * @returns A Promise of DnsRecords */ - syncDomainDnsRecords = (request: Readonly) => + syncDomainDnsRecords = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalDnsApiSyncDomainDnsRecordsRequest(request, this.client.settings), + marshalDnsApiSyncDomainDnsRecordsRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -670,7 +693,6 @@ export class DnsAPI extends ParentAPI { unmarshalDnsRecords, ) - /** * Search for available domains based on domain name.. Search for available domains based on domain name. * @@ -684,13 +706,15 @@ export class DnsAPI extends ParentAPI { path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/search-domains`, urlParams: urlParams( ['domain_name', request.domainName], - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], + [ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ], ), }, unmarshalSearchDomainsResponse, ) - /** * Retrieve detailed information about a specific domain, including its status, DNS configuration, and ownership.. Retrieve detailed information about a specific domain, including its status, DNS configuration, and ownership. * @@ -702,13 +726,14 @@ export class DnsAPI extends ParentAPI { { method: 'GET', path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainName', request.domainName)}`, - urlParams: urlParams( - ['project_id', request.projectId ?? this.client.settings.defaultProjectId], - ), + urlParams: urlParams([ + 'project_id', + request.projectId ?? this.client.settings.defaultProjectId, + ]), }, unmarshalDomain, ) - + /** * Waits for {@link Domain} to be in a final state. * @@ -721,13 +746,15 @@ export class DnsAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!DOMAIN_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !DOMAIN_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status), + )), this.getDomain, request, options, ) - - } /** @@ -740,16 +767,13 @@ export class OfferAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListOffers = (request: Readonly = {}) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListOffers = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -759,12 +783,15 @@ export class OfferAPI extends ParentAPI { ['hosting_id', request.hostingId], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListOffersResponse, ) - + /** * List all available hosting offers along with their specific options.. List all available hosting offers along with their specific options. * @@ -773,8 +800,6 @@ export class OfferAPI extends ParentAPI { */ listOffers = (request: Readonly = {}) => enrichForPagination('offers', this.pageOfListOffers, request) - - } /** @@ -787,15 +812,10 @@ export class HostingAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Order a Web Hosting plan. Order a Web Hosting plan, specifying the offer type required via the `offer_id` parameter. * @@ -815,8 +835,9 @@ export class HostingAPI extends ParentAPI { unmarshalHosting, ) - - protected pageOfListHostings = (request: Readonly = {}) => + protected pageOfListHostings = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', @@ -827,7 +848,10 @@ export class HostingAPI extends ParentAPI { ['order_by', request.orderBy], ['organization_id', request.organizationId], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ['project_id', request.projectId], ['statuses', request.statuses], ['subdomain', request.subdomain], @@ -836,7 +860,7 @@ export class HostingAPI extends ParentAPI { }, unmarshalListHostingsResponse, ) - + /** * List all Web Hosting plans. List all of your existing Web Hosting plans. Various filters are available to limit the results, including filtering by domain, status, tag and Project ID. * @@ -846,7 +870,6 @@ export class HostingAPI extends ParentAPI { listHostings = (request: Readonly = {}) => enrichForPagination('hostings', this.pageOfListHostings, request) - /** * Get a Web Hosting plan. Get the details of one of your existing Web Hosting plans, specified by its `hosting_id`. * @@ -861,7 +884,7 @@ export class HostingAPI extends ParentAPI { }, unmarshalHosting, ) - + /** * Waits for {@link Hosting} to be in a final state. * @@ -874,13 +897,16 @@ export class HostingAPI extends ParentAPI { options?: Readonly>, ) => waitForResource( - options?.stop ?? (res => Promise.resolve(!HOSTING_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status))), + options?.stop ?? + (res => + Promise.resolve( + !HOSTING_TRANSIENT_STATUSES_WEBHOSTING.includes(res.status), + )), this.getHosting, request, options, ) - /** * Update a Web Hosting plan. Update the details of one of your existing Web Hosting plans, specified by its `hosting_id`. You can update parameters including the contact email address, tags, options and offer. * @@ -900,7 +926,6 @@ export class HostingAPI extends ParentAPI { unmarshalHosting, ) - /** * Delete a Web Hosting plan. Delete a Web Hosting plan, specified by its `hosting_id`. Note that deletion is not immediate: it will take place at the end of the calendar month, after which time your Web Hosting plan and all its data (files and emails) will be irreversibly lost. * @@ -916,7 +941,6 @@ export class HostingAPI extends ParentAPI { unmarshalHosting, ) - /** * Create a user session. * @@ -934,14 +958,15 @@ export class HostingAPI extends ParentAPI { unmarshalSession, ) - /** * Reset a Web Hosting plan password. * * @param request - The request {@link HostingApiResetHostingPasswordRequest} * @returns A Promise of ResetHostingPasswordResponse */ - resetHostingPassword = (request: Readonly) => + resetHostingPassword = ( + request: Readonly, + ) => this.client.fetch( { body: '{}', @@ -952,14 +977,15 @@ export class HostingAPI extends ParentAPI { unmarshalResetHostingPasswordResponse, ) - /** * Get the total counts of websites, databases, email accounts, and FTP accounts of a Web Hosting plan. * * @param request - The request {@link HostingApiGetResourceSummaryRequest} * @returns A Promise of ResourceSummary */ - getResourceSummary = (request: Readonly) => + getResourceSummary = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -968,7 +994,6 @@ export class HostingAPI extends ParentAPI { unmarshalResourceSummary, ) - /** * Attach a custom domain to a webhosting as an alias to the main domain. * @@ -979,7 +1004,10 @@ export class HostingAPI extends ParentAPI { this.client.fetch( { body: JSON.stringify( - marshalHostingApiAddCustomDomainRequest(request, this.client.settings), + marshalHostingApiAddCustomDomainRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -988,18 +1016,22 @@ export class HostingAPI extends ParentAPI { unmarshalHostingSummary, ) - /** * Detach a custom domain from a webhosting. * * @param request - The request {@link HostingApiRemoveCustomDomainRequest} * @returns A Promise of HostingSummary */ - removeCustomDomain = (request: Readonly) => + removeCustomDomain = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalHostingApiRemoveCustomDomainRequest(request, this.client.settings), + marshalHostingApiRemoveCustomDomainRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1007,28 +1039,6 @@ export class HostingAPI extends ParentAPI { }, unmarshalHostingSummary, ) - - - /** - * Migrate a hosting to a new control panel.. Migrate a hosting to a new control panel. - * - * @param request - The request {@link HostingApiMigrateControlPanelRequest} - * @returns A Promise of HostingSummary - */ - migrateControlPanel = (request: Readonly) => - this.client.fetch( - { - body: JSON.stringify( - marshalHostingApiMigrateControlPanelRequest(request, this.client.settings), - ), - headers: jsonContentHeaders, - method: 'POST', - path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/migrate-control-panel`, - }, - unmarshalHostingSummary, - ) - - } /** @@ -1041,26 +1051,26 @@ export class FreeDomainAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Check whether a given slug and free domain combination is available.. Check whether a given slug and free domain combination is available. * * @param request - The request {@link FreeDomainApiCheckFreeDomainAvailabilityRequest} * @returns A Promise of CheckFreeDomainAvailabilityResponse */ - checkFreeDomainAvailability = (request: Readonly) => + checkFreeDomainAvailability = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalFreeDomainApiCheckFreeDomainAvailabilityRequest(request, this.client.settings), + marshalFreeDomainApiCheckFreeDomainAvailabilityRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1069,30 +1079,34 @@ export class FreeDomainAPI extends ParentAPI { unmarshalCheckFreeDomainAvailabilityResponse, ) - - protected pageOfListFreeRootDomains = (request: Readonly = {}) => + protected pageOfListFreeRootDomains = ( + request: Readonly = {}, + ) => this.client.fetch( { method: 'GET', path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/free-domains/root-domains`, urlParams: urlParams( ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListFreeRootDomainsResponse, ) - + /** * Retrieve the list of free root domains available for a Web Hosting.. Retrieve the list of free root domains available for a Web Hosting. * * @param request - The request {@link FreeDomainApiListFreeRootDomainsRequest} * @returns A Promise of ListFreeRootDomainsResponse */ - listFreeRootDomains = (request: Readonly = {}) => + listFreeRootDomains = ( + request: Readonly = {}, + ) => enrichForPagination('rootDomains', this.pageOfListFreeRootDomains, request) - - } /** @@ -1105,26 +1119,26 @@ export class FtpAccountAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Create a new FTP account within your hosting plan.. Create a new FTP account within your hosting plan. * * @param request - The request {@link FtpAccountApiCreateFtpAccountRequest} * @returns A Promise of FtpAccount */ - createFtpAccount = (request: Readonly) => + createFtpAccount = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalFtpAccountApiCreateFtpAccountRequest(request, this.client.settings), + marshalFtpAccountApiCreateFtpAccountRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1133,8 +1147,9 @@ export class FtpAccountAPI extends ParentAPI { unmarshalFtpAccount, ) - - protected pageOfListFtpAccounts = (request: Readonly) => + protected pageOfListFtpAccounts = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1143,12 +1158,15 @@ export class FtpAccountAPI extends ParentAPI { ['domain', request.domain], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListFtpAccountsResponse, ) - + /** * List all FTP accounts within your hosting plan.. List all FTP accounts within your hosting plan. * @@ -1158,14 +1176,15 @@ export class FtpAccountAPI extends ParentAPI { listFtpAccounts = (request: Readonly) => enrichForPagination('ftpAccounts', this.pageOfListFtpAccounts, request) - /** * Delete a specific FTP account within your hosting plan.. Delete a specific FTP account within your hosting plan. * * @param request - The request {@link FtpAccountApiRemoveFtpAccountRequest} * @returns A Promise of FtpAccount */ - removeFtpAccount = (request: Readonly) => + removeFtpAccount = ( + request: Readonly, + ) => this.client.fetch( { method: 'DELETE', @@ -1174,12 +1193,16 @@ export class FtpAccountAPI extends ParentAPI { unmarshalFtpAccount, ) - - changeFtpAccountPassword = (request: Readonly) => + changeFtpAccountPassword = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalFtpAccountApiChangeFtpAccountPasswordRequest(request, this.client.settings), + marshalFtpAccountApiChangeFtpAccountPasswordRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1187,8 +1210,6 @@ export class FtpAccountAPI extends ParentAPI { }, unmarshalFtpAccount, ) - - } /** @@ -1201,26 +1222,26 @@ export class MailAccountAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + /** * Create a new mail account within your hosting plan.. Create a new mail account within your hosting plan. * * @param request - The request {@link MailAccountApiCreateMailAccountRequest} * @returns A Promise of MailAccount */ - createMailAccount = (request: Readonly) => + createMailAccount = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalMailAccountApiCreateMailAccountRequest(request, this.client.settings), + marshalMailAccountApiCreateMailAccountRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1229,8 +1250,9 @@ export class MailAccountAPI extends ParentAPI { unmarshalMailAccount, ) - - protected pageOfListMailAccounts = (request: Readonly) => + protected pageOfListMailAccounts = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1239,33 +1261,41 @@ export class MailAccountAPI extends ParentAPI { ['domain', request.domain], ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListMailAccountsResponse, ) - + /** * List all mail accounts within your hosting plan.. List all mail accounts within your hosting plan. * * @param request - The request {@link MailAccountApiListMailAccountsRequest} * @returns A Promise of ListMailAccountsResponse */ - listMailAccounts = (request: Readonly) => - enrichForPagination('mailAccounts', this.pageOfListMailAccounts, request) + listMailAccounts = ( + request: Readonly, + ) => enrichForPagination('mailAccounts', this.pageOfListMailAccounts, request) - /** * Delete a mail account within your hosting plan.. Delete a mail account within your hosting plan. * * @param request - The request {@link MailAccountApiRemoveMailAccountRequest} * @returns A Promise of MailAccount */ - removeMailAccount = (request: Readonly) => + removeMailAccount = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalMailAccountApiRemoveMailAccountRequest(request, this.client.settings), + marshalMailAccountApiRemoveMailAccountRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1274,18 +1304,22 @@ export class MailAccountAPI extends ParentAPI { unmarshalMailAccount, ) - /** * Update the password of a mail account within your hosting plan.. Update the password of a mail account within your hosting plan. * * @param request - The request {@link MailAccountApiChangeMailAccountPasswordRequest} * @returns A Promise of MailAccount */ - changeMailAccountPassword = (request: Readonly) => + changeMailAccountPassword = ( + request: Readonly, + ) => this.client.fetch( { body: JSON.stringify( - marshalMailAccountApiChangeMailAccountPasswordRequest(request, this.client.settings), + marshalMailAccountApiChangeMailAccountPasswordRequest( + request, + this.client.settings, + ), ), headers: jsonContentHeaders, method: 'POST', @@ -1293,8 +1327,6 @@ export class MailAccountAPI extends ParentAPI { }, unmarshalMailAccount, ) - - } /** @@ -1307,16 +1339,13 @@ export class WebsiteAPI extends ParentAPI { * Locality of this API. * type ∈ {'zone','region','global','unspecified'} */ - public static readonly LOCALITY: ApiLocality = - toApiLocality({ - regions: [ - 'fr-par', - 'nl-ams', - 'pl-waw', - ], - }) - - protected pageOfListWebsites = (request: Readonly) => + public static readonly LOCALITY: ApiLocality = toApiLocality({ + regions: ['fr-par', 'nl-ams', 'pl-waw'], + }) + + protected pageOfListWebsites = ( + request: Readonly, + ) => this.client.fetch( { method: 'GET', @@ -1324,12 +1353,15 @@ export class WebsiteAPI extends ParentAPI { urlParams: urlParams( ['order_by', request.orderBy], ['page', request.page], - ['page_size', request.pageSize ?? this.client.settings.defaultPageSize], + [ + 'page_size', + request.pageSize ?? this.client.settings.defaultPageSize, + ], ), }, unmarshalListWebsitesResponse, ) - + /** * List all websites for a specific hosting.. List all websites for a specific hosting. * @@ -1339,7 +1371,6 @@ export class WebsiteAPI extends ParentAPI { listWebsites = (request: Readonly) => enrichForPagination('websites', this.pageOfListWebsites, request) - /** * Create a new website and attach it to a webhosting. * @@ -1359,20 +1390,14 @@ export class WebsiteAPI extends ParentAPI { unmarshalWebsite, ) - /** * Delete a website from a webhosting. * * @param request - The request {@link WebsiteApiDeleteWebsiteRequest} */ deleteWebsite = (request: Readonly) => - this.client.fetch( - { - method: 'DELETE', - path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/websites/${validatePathParam('domainName', request.domainName)}`, - }, - ) - - + this.client.fetch({ + method: 'DELETE', + path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/hostings/${validatePathParam('hostingId', request.hostingId)}/websites/${validatePathParam('domainName', request.domainName)}`, + }) } - diff --git a/packages_generated/webhosting/src/v1/content.gen.ts b/packages_generated/webhosting/src/v1/content.gen.ts index cf35a83af..f98f27138 100644 --- a/packages_generated/webhosting/src/v1/content.gen.ts +++ b/packages_generated/webhosting/src/v1/content.gen.ts @@ -7,21 +7,15 @@ import type { HostingStatus, } from './types.gen.js' - /** Lists transient statutes of the enum {@link BackupStatus}. */ -export const BACKUP_TRANSIENT_STATUSES: BackupStatus[] = [ - 'restoring', -] +export const BACKUP_TRANSIENT_STATUSES: BackupStatus[] = ['restoring'] /** Lists transient statutes of the enum {@link DomainAvailabilityStatus}. */ -export const DOMAIN_AVAILABILITY_TRANSIENT_STATUSES: DomainAvailabilityStatus[] = [ - 'validating', -] +export const DOMAIN_AVAILABILITY_TRANSIENT_STATUSES: DomainAvailabilityStatus[] = + ['validating'] /** Lists transient statutes of the enum {@link DomainStatus}. */ -export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = [ - 'validating', -] +export const DOMAIN_TRANSIENT_STATUSES: DomainStatus[] = ['validating'] /** Lists transient statutes of the enum {@link HostingStatus}. */ export const HOSTING_TRANSIENT_STATUSES: HostingStatus[] = [ @@ -30,4 +24,3 @@ export const HOSTING_TRANSIENT_STATUSES: HostingStatus[] = [ 'migrating', 'updating', ] - diff --git a/packages_generated/webhosting/src/v1/marshalling.gen.ts b/packages_generated/webhosting/src/v1/marshalling.gen.ts index 56933a51f..4a4863644 100644 --- a/packages_generated/webhosting/src/v1/marshalling.gen.ts +++ b/packages_generated/webhosting/src/v1/marshalling.gen.ts @@ -1,5 +1,10 @@ - -import { isJSONObject, resolveOneOf, unmarshalArrayOfObject, unmarshalDate, unmarshalMoney, } from '@scaleway/sdk-client' +import { + isJSONObject, + resolveOneOf, + unmarshalArrayOfObject, + unmarshalDate, + unmarshalMoney, +} from '@scaleway/sdk-client' import type { DefaultValues } from '@scaleway/sdk-client' import type { Backup, @@ -147,7 +152,9 @@ const unmarshalAutoConfigDomainDns = (data: unknown): AutoConfigDomainDns => { } as AutoConfigDomainDns } -const unmarshalHostingDomainCustomDomain = (data: unknown): HostingDomainCustomDomain => { +const unmarshalHostingDomainCustomDomain = ( + data: unknown, +): HostingDomainCustomDomain => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'HostingDomainCustomDomain' failed as data isn't a dictionary.`, @@ -155,7 +162,9 @@ const unmarshalHostingDomainCustomDomain = (data: unknown): HostingDomainCustomD } return { - autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : undefined, + autoConfigDomainDns: data.auto_config_domain_dns + ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) + : undefined, dnsStatus: data.dns_status, domain: data.domain, domainStatus: data.domain_status, @@ -170,7 +179,9 @@ const unmarshalHostingDomain = (data: unknown): HostingDomain => { } return { - customDomain: data.custom_domain ? unmarshalHostingDomainCustomDomain(data.custom_domain) : undefined, + customDomain: data.custom_domain + ? unmarshalHostingDomainCustomDomain(data.custom_domain) + : undefined, subdomain: data.subdomain, } as HostingDomain } @@ -186,7 +197,9 @@ export const unmarshalHostingSummary = (data: unknown): HostingSummary => { createdAt: unmarshalDate(data.created_at), dnsStatus: data.dns_status ? data.dns_status : undefined, domain: data.domain, - domainInfo: data.domain_info ? unmarshalHostingDomain(data.domain_info) : undefined, + domainInfo: data.domain_info + ? unmarshalHostingDomain(data.domain_info) + : undefined, domainStatus: data.domain_status ? data.domain_status : undefined, id: data.id, offerName: data.offer_name, @@ -238,7 +251,9 @@ const unmarshalFreeDomain = (data: unknown): FreeDomain => { } as FreeDomain } -export const unmarshalCheckFreeDomainAvailabilityResponse = (data: unknown): CheckFreeDomainAvailabilityResponse => { +export const unmarshalCheckFreeDomainAvailabilityResponse = ( + data: unknown, +): CheckFreeDomainAvailabilityResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckFreeDomainAvailabilityResponse' failed as data isn't a dictionary.`, @@ -246,13 +261,17 @@ export const unmarshalCheckFreeDomainAvailabilityResponse = (data: unknown): Che } return { - freeDomain: data.free_domain ? unmarshalFreeDomain(data.free_domain) : undefined, + freeDomain: data.free_domain + ? unmarshalFreeDomain(data.free_domain) + : undefined, isAvailable: data.is_available, reason: data.reason ? data.reason : undefined, } as CheckFreeDomainAvailabilityResponse } -export const unmarshalCheckUserOwnsDomainResponse = (data: unknown): CheckUserOwnsDomainResponse => { +export const unmarshalCheckUserOwnsDomainResponse = ( + data: unknown, +): CheckUserOwnsDomainResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'CheckUserOwnsDomainResponse' failed as data isn't a dictionary.`, @@ -304,7 +323,9 @@ export const unmarshalDnsRecords = (data: unknown): DnsRecords => { } return { - autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : undefined, + autoConfigDomainDns: data.auto_config_domain_dns + ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) + : undefined, dnsConfig: data.dns_config ? data.dns_config : undefined, nameServers: unmarshalArrayOfObject(data.name_servers, unmarshalNameserver), records: unmarshalArrayOfObject(data.records, unmarshalDnsRecord), @@ -320,9 +341,13 @@ export const unmarshalDomain = (data: unknown): Domain => { } return { - autoConfigDomainDns: data.auto_config_domain_dns ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) : undefined, + autoConfigDomainDns: data.auto_config_domain_dns + ? unmarshalAutoConfigDomainDns(data.auto_config_domain_dns) + : undefined, availableActions: data.available_actions, - availableDnsActions: data.available_dns_actions ? data.available_dns_actions : undefined, + availableDnsActions: data.available_dns_actions + ? data.available_dns_actions + : undefined, name: data.name, owner: data.owner, status: data.status, @@ -330,7 +355,9 @@ export const unmarshalDomain = (data: unknown): Domain => { } as Domain } -const unmarshalPlatformControlPanelUrls = (data: unknown): PlatformControlPanelUrls => { +const unmarshalPlatformControlPanelUrls = ( + data: unknown, +): PlatformControlPanelUrls => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'PlatformControlPanelUrls' failed as data isn't a dictionary.`, @@ -416,7 +443,10 @@ const unmarshalOffer = (data: unknown): Offer => { available: data.available, billingOperationPath: data.billing_operation_path, controlPanelName: data.control_panel_name, - controlPanels: unmarshalArrayOfObject(data.control_panels, unmarshalControlPanel), + controlPanels: unmarshalArrayOfObject( + data.control_panels, + unmarshalControlPanel, + ), endOfLife: data.end_of_life, id: data.id, name: data.name, @@ -435,7 +465,9 @@ const unmarshalPlatform = (data: unknown): Platform => { } return { - controlPanel: data.control_panel ? unmarshalPlatformControlPanel(data.control_panel) : undefined, + controlPanel: data.control_panel + ? unmarshalPlatformControlPanel(data.control_panel) + : undefined, groupName: data.group_name, hostname: data.hostname, ipv4: data.ipv4, @@ -455,7 +487,9 @@ export const unmarshalHosting = (data: unknown): Hosting => { createdAt: unmarshalDate(data.created_at), dnsStatus: data.dns_status ? data.dns_status : undefined, domain: data.domain, - domainInfo: data.domain_info ? unmarshalHostingDomain(data.domain_info) : undefined, + domainInfo: data.domain_info + ? unmarshalHostingDomain(data.domain_info) + : undefined, domainStatus: data.domain_status ? data.domain_status : undefined, id: data.id, ipv4: data.ipv4, @@ -501,7 +535,9 @@ const unmarshalBackupItemGroup = (data: unknown): BackupItemGroup => { } as BackupItemGroup } -export const unmarshalListBackupItemsResponse = (data: unknown): ListBackupItemsResponse => { +export const unmarshalListBackupItemsResponse = ( + data: unknown, +): ListBackupItemsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBackupItemsResponse' failed as data isn't a dictionary.`, @@ -514,7 +550,9 @@ export const unmarshalListBackupItemsResponse = (data: unknown): ListBackupItems } as ListBackupItemsResponse } -export const unmarshalListBackupsResponse = (data: unknown): ListBackupsResponse => { +export const unmarshalListBackupsResponse = ( + data: unknown, +): ListBackupsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListBackupsResponse' failed as data isn't a dictionary.`, @@ -527,7 +565,9 @@ export const unmarshalListBackupsResponse = (data: unknown): ListBackupsResponse } as ListBackupsResponse } -export const unmarshalListControlPanelsResponse = (data: unknown): ListControlPanelsResponse => { +export const unmarshalListControlPanelsResponse = ( + data: unknown, +): ListControlPanelsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListControlPanelsResponse' failed as data isn't a dictionary.`, @@ -535,12 +575,17 @@ export const unmarshalListControlPanelsResponse = (data: unknown): ListControlPa } return { - controlPanels: unmarshalArrayOfObject(data.control_panels, unmarshalControlPanel), + controlPanels: unmarshalArrayOfObject( + data.control_panels, + unmarshalControlPanel, + ), totalCount: data.total_count, } as ListControlPanelsResponse } -export const unmarshalListDatabaseUsersResponse = (data: unknown): ListDatabaseUsersResponse => { +export const unmarshalListDatabaseUsersResponse = ( + data: unknown, +): ListDatabaseUsersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabaseUsersResponse' failed as data isn't a dictionary.`, @@ -553,7 +598,9 @@ export const unmarshalListDatabaseUsersResponse = (data: unknown): ListDatabaseU } as ListDatabaseUsersResponse } -export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResponse => { +export const unmarshalListDatabasesResponse = ( + data: unknown, +): ListDatabasesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListDatabasesResponse' failed as data isn't a dictionary.`, @@ -566,7 +613,9 @@ export const unmarshalListDatabasesResponse = (data: unknown): ListDatabasesResp } as ListDatabasesResponse } -export const unmarshalListFreeRootDomainsResponse = (data: unknown): ListFreeRootDomainsResponse => { +export const unmarshalListFreeRootDomainsResponse = ( + data: unknown, +): ListFreeRootDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFreeRootDomainsResponse' failed as data isn't a dictionary.`, @@ -579,7 +628,9 @@ export const unmarshalListFreeRootDomainsResponse = (data: unknown): ListFreeRoo } as ListFreeRootDomainsResponse } -export const unmarshalListFtpAccountsResponse = (data: unknown): ListFtpAccountsResponse => { +export const unmarshalListFtpAccountsResponse = ( + data: unknown, +): ListFtpAccountsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListFtpAccountsResponse' failed as data isn't a dictionary.`, @@ -592,7 +643,9 @@ export const unmarshalListFtpAccountsResponse = (data: unknown): ListFtpAccounts } as ListFtpAccountsResponse } -export const unmarshalListHostingsResponse = (data: unknown): ListHostingsResponse => { +export const unmarshalListHostingsResponse = ( + data: unknown, +): ListHostingsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListHostingsResponse' failed as data isn't a dictionary.`, @@ -605,7 +658,9 @@ export const unmarshalListHostingsResponse = (data: unknown): ListHostingsRespon } as ListHostingsResponse } -export const unmarshalListMailAccountsResponse = (data: unknown): ListMailAccountsResponse => { +export const unmarshalListMailAccountsResponse = ( + data: unknown, +): ListMailAccountsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListMailAccountsResponse' failed as data isn't a dictionary.`, @@ -613,12 +668,17 @@ export const unmarshalListMailAccountsResponse = (data: unknown): ListMailAccoun } return { - mailAccounts: unmarshalArrayOfObject(data.mail_accounts, unmarshalMailAccount), + mailAccounts: unmarshalArrayOfObject( + data.mail_accounts, + unmarshalMailAccount, + ), totalCount: data.total_count, } as ListMailAccountsResponse } -export const unmarshalListOffersResponse = (data: unknown): ListOffersResponse => { +export const unmarshalListOffersResponse = ( + data: unknown, +): ListOffersResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListOffersResponse' failed as data isn't a dictionary.`, @@ -646,7 +706,9 @@ const unmarshalProgressSummary = (data: unknown): ProgressSummary => { } as ProgressSummary } -export const unmarshalListRecentProgressesResponse = (data: unknown): ListRecentProgressesResponse => { +export const unmarshalListRecentProgressesResponse = ( + data: unknown, +): ListRecentProgressesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListRecentProgressesResponse' failed as data isn't a dictionary.`, @@ -654,11 +716,16 @@ export const unmarshalListRecentProgressesResponse = (data: unknown): ListRecent } return { - progresses: unmarshalArrayOfObject(data.progresses, unmarshalProgressSummary), + progresses: unmarshalArrayOfObject( + data.progresses, + unmarshalProgressSummary, + ), } as ListRecentProgressesResponse } -export const unmarshalListWebsitesResponse = (data: unknown): ListWebsitesResponse => { +export const unmarshalListWebsitesResponse = ( + data: unknown, +): ListWebsitesResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ListWebsitesResponse' failed as data isn't a dictionary.`, @@ -679,14 +746,19 @@ export const unmarshalProgress = (data: unknown): Progress => { } return { - backupItemGroups: unmarshalArrayOfObject(data.backup_item_groups, unmarshalBackupItemGroup), + backupItemGroups: unmarshalArrayOfObject( + data.backup_item_groups, + unmarshalBackupItemGroup, + ), id: data.id, percentage: data.percentage, status: data.status, } as Progress } -export const unmarshalResetHostingPasswordResponse = (data: unknown): ResetHostingPasswordResponse => { +export const unmarshalResetHostingPasswordResponse = ( + data: unknown, +): ResetHostingPasswordResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'ResetHostingPasswordResponse' failed as data isn't a dictionary.`, @@ -714,7 +786,9 @@ export const unmarshalResourceSummary = (data: unknown): ResourceSummary => { } as ResourceSummary } -export const unmarshalRestoreBackupItemsResponse = (data: unknown): RestoreBackupItemsResponse => { +export const unmarshalRestoreBackupItemsResponse = ( + data: unknown, +): RestoreBackupItemsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RestoreBackupItemsResponse' failed as data isn't a dictionary.`, @@ -726,7 +800,9 @@ export const unmarshalRestoreBackupItemsResponse = (data: unknown): RestoreBacku } as RestoreBackupItemsResponse } -export const unmarshalRestoreBackupResponse = (data: unknown): RestoreBackupResponse => { +export const unmarshalRestoreBackupResponse = ( + data: unknown, +): RestoreBackupResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'RestoreBackupResponse' failed as data isn't a dictionary.`, @@ -755,7 +831,9 @@ const unmarshalDomainAvailability = (data: unknown): DomainAvailability => { } as DomainAvailability } -export const unmarshalSearchDomainsResponse = (data: unknown): SearchDomainsResponse => { +export const unmarshalSearchDomainsResponse = ( + data: unknown, +): SearchDomainsResponse => { if (!isJSONObject(data)) { throw new TypeError( `Unmarshalling the type 'SearchDomainsResponse' failed as data isn't a dictionary.`, @@ -763,7 +841,10 @@ export const unmarshalSearchDomainsResponse = (data: unknown): SearchDomainsResp } return { - domainsAvailable: unmarshalArrayOfObject(data.domains_available, unmarshalDomainAvailability), + domainsAvailable: unmarshalArrayOfObject( + data.domains_available, + unmarshalDomainAvailability, + ), } as SearchDomainsResponse } @@ -812,15 +893,16 @@ export const marshalDatabaseApiCreateDatabaseRequest = ( request: DatabaseApiCreateDatabaseRequest, defaults: DefaultValues, ): Record => ({ - database_name: request.databaseName, + database_name: request.databaseName, ...resolveOneOf | string>([ - {param: 'new_user', - value: (request.newUser !== undefined) ? marshalCreateDatabaseRequestUser(request.newUser, defaults) - : undefined, - }, - {param: 'existing_username', - value: request.existingUsername, + { + param: 'new_user', + value: + request.newUser !== undefined + ? marshalCreateDatabaseRequestUser(request.newUser, defaults) + : undefined, }, + { param: 'existing_username', value: request.existingUsername }, ]), }) @@ -869,8 +951,16 @@ export const marshalDnsApiSyncDomainDnsRecordsRequest = ( request: DnsApiSyncDomainDnsRecordsRequest, defaults: DefaultValues, ): Record => ({ - auto_config_domain_dns: ((request.autoConfigDomainDns !== undefined) ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults): undefined), - custom_records: ((request.customRecords !== undefined) ? request.customRecords.map(elt => marshalSyncDomainDnsRecordsRequestRecord(elt, defaults)): undefined), + auto_config_domain_dns: + request.autoConfigDomainDns !== undefined + ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults) + : undefined, + custom_records: + request.customRecords !== undefined + ? request.customRecords.map(elt => + marshalSyncDomainDnsRecordsRequestRecord(elt, defaults), + ) + : undefined, update_all_records: request.updateAllRecords, update_mail_records: request.updateMailRecords, update_nameservers: request.updateNameservers, @@ -930,13 +1020,27 @@ export const marshalHostingApiCreateHostingRequest = ( request: HostingApiCreateHostingRequest, defaults: DefaultValues, ): Record => ({ - auto_config_domain_dns: ((request.autoConfigDomainDns !== undefined) ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults): undefined), + auto_config_domain_dns: + request.autoConfigDomainDns !== undefined + ? marshalAutoConfigDomainDns(request.autoConfigDomainDns, defaults) + : undefined, domain: request.domain, - domain_configuration: ((request.domainConfiguration !== undefined) ? marshalCreateHostingRequestDomainConfiguration(request.domainConfiguration, defaults): undefined), + domain_configuration: + request.domainConfiguration !== undefined + ? marshalCreateHostingRequestDomainConfiguration( + request.domainConfiguration, + defaults, + ) + : undefined, email: request.email, language: request.language, offer_id: request.offerId, - offer_options: ((request.offerOptions !== undefined) ? request.offerOptions.map(elt => marshalOfferOptionRequest(elt, defaults)): undefined), + offer_options: + request.offerOptions !== undefined + ? request.offerOptions.map(elt => + marshalOfferOptionRequest(elt, defaults), + ) + : undefined, project_id: request.projectId ?? defaults.defaultProjectId, skip_welcome_email: request.skipWelcomeEmail, subdomain: request.subdomain, @@ -964,7 +1068,12 @@ export const marshalHostingApiUpdateHostingRequest = ( ): Record => ({ email: request.email, offer_id: request.offerId, - offer_options: ((request.offerOptions !== undefined) ? request.offerOptions.map(elt => marshalOfferOptionRequest(elt, defaults)): undefined), + offer_options: + request.offerOptions !== undefined + ? request.offerOptions.map(elt => + marshalOfferOptionRequest(elt, defaults), + ) + : undefined, protected: request.protected, tags: request.tags, }) diff --git a/packages_generated/webhosting/src/v1/types.gen.ts b/packages_generated/webhosting/src/v1/types.gen.ts index 4075fc419..92ad4392d 100644 --- a/packages_generated/webhosting/src/v1/types.gen.ts +++ b/packages_generated/webhosting/src/v1/types.gen.ts @@ -1,8 +1,7 @@ // This file was automatically generated. DO NOT EDIT. // If you have any remark or suggestion do not hesitate to open an issue. -import type { Money, Region as ScwRegion, } from '@scaleway/sdk-client' -import type {LanguageCode as StdLanguageCode,} from '@scaleway/sdk-std' - +import type { Money, Region as ScwRegion } from '@scaleway/sdk-client' +import type { LanguageCode as StdLanguageCode } from '@scaleway/sdk-std' export type BackupItemType = | 'unknown_backup_item_type' @@ -34,10 +33,7 @@ export type CheckFreeDomainAvailabilityResponseUnavailableReason = | 'unavailable_reason_contains_dots' | 'unavailable_reason_contains_reserved_keyword' -export type DnsRecordStatus = - | 'unknown_status' - | 'valid' - | 'invalid' +export type DnsRecordStatus = 'unknown_status' | 'valid' | 'invalid' export type DnsRecordType = | 'unknown_type' @@ -48,10 +44,7 @@ export type DnsRecordType = | 'ns' | 'aaaa' -export type DnsRecordsStatus = - | 'unknown_status' - | 'valid' - | 'invalid' +export type DnsRecordsStatus = 'unknown_status' | 'valid' | 'invalid' export type DomainAction = | 'unknown_action' @@ -105,25 +98,17 @@ export type HostingStatus = | 'migrating' | 'updating' -export type ListBackupsRequestOrderBy = - | 'created_at_desc' - | 'created_at_asc' +export type ListBackupsRequestOrderBy = 'created_at_desc' | 'created_at_asc' -export type ListDatabaseUsersRequestOrderBy = - | 'username_asc' - | 'username_desc' +export type ListDatabaseUsersRequestOrderBy = 'username_asc' | 'username_desc' export type ListDatabasesRequestOrderBy = | 'database_name_asc' | 'database_name_desc' -export type ListFtpAccountsRequestOrderBy = - | 'username_asc' - | 'username_desc' +export type ListFtpAccountsRequestOrderBy = 'username_asc' | 'username_desc' -export type ListHostingsRequestOrderBy = - | 'created_at_asc' - | 'created_at_desc' +export type ListHostingsRequestOrderBy = 'created_at_asc' | 'created_at_desc' export type ListMailAccountsRequestOrderBy = | 'username_asc' @@ -131,17 +116,11 @@ export type ListMailAccountsRequestOrderBy = | 'domain_asc' | 'domain_desc' -export type ListOffersRequestOrderBy = - | 'price_asc' +export type ListOffersRequestOrderBy = 'price_asc' -export type ListWebsitesRequestOrderBy = - | 'domain_asc' - | 'domain_desc' +export type ListWebsitesRequestOrderBy = 'domain_asc' | 'domain_desc' -export type NameserverStatus = - | 'unknown_status' - | 'valid' - | 'invalid' +export type NameserverStatus = 'unknown_status' | 'valid' | 'invalid' export type OfferOptionName = | 'unknown_name' @@ -162,10 +141,7 @@ export type OfferOptionWarning = | 'quota_exceeded_warning' | 'usage_low_warning' -export type PlatformPlatformGroup = - | 'unknown_group' - | 'default' - | 'premium' +export type PlatformPlatformGroup = 'unknown_group' | 'default' | 'premium' export type ProgressStatus = | 'unknown_status' @@ -200,7 +176,6 @@ export interface AutoConfigDomainDns { none: boolean } - export interface PlatformControlPanelUrls { /** * URL to connect to the hosting control panel dashboard. @@ -212,7 +187,6 @@ export interface PlatformControlPanelUrls { webmail: string } - export interface HostingDomainCustomDomain { /** * Custom domain linked to the hosting plan. @@ -232,7 +206,6 @@ export interface HostingDomainCustomDomain { autoConfigDomainDns?: AutoConfigDomainDns } - export interface ControlPanel { /** * Control panel name. @@ -252,7 +225,6 @@ export interface ControlPanel { availableLanguages: StdLanguageCode[] } - export interface OfferOption { /** * Option ID. @@ -288,7 +260,6 @@ export interface OfferOption { price?: Money } - export interface PlatformControlPanel { /** * Name of the control panel. @@ -300,7 +271,6 @@ export interface PlatformControlPanel { urls?: PlatformControlPanelUrls } - export interface BackupItem { /** * ID of the item. @@ -328,7 +298,6 @@ export interface BackupItem { createdAt?: Date } - export interface HostingDomain { /** * Optional free subdomain linked to the Web Hosting plan. @@ -340,7 +309,6 @@ export interface HostingDomain { customDomain?: HostingDomainCustomDomain } - export interface FreeDomain { /** * Custom prefix used for the free domain. @@ -352,13 +320,11 @@ export interface FreeDomain { rootDomain: string } - export interface CreateDatabaseRequestUser { username: string password: string } - export interface CreateHostingRequestDomainConfiguration { updateNameservers: boolean updateWebRecord: boolean @@ -366,7 +332,6 @@ export interface CreateHostingRequestDomainConfiguration { updateAllRecords: boolean } - export interface OfferOptionRequest { /** * Offer option ID. @@ -378,13 +343,11 @@ export interface OfferOptionRequest { quantity: number } - export interface SyncDomainDnsRecordsRequestRecord { name: string type: DnsRecordType } - export interface DnsRecord { /** * Record name. @@ -416,7 +379,6 @@ export interface DnsRecord { rawData: string } - export interface Nameserver { /** * Hostname of the nameserver. @@ -432,7 +394,6 @@ export interface Nameserver { isDefault: boolean } - export interface HostingUser { /** * Main Web Hosting control panel username. @@ -452,7 +413,6 @@ export interface HostingUser { oneTimePasswordB64?: string } - export interface Offer { /** * Offer ID. @@ -500,7 +460,6 @@ export interface Offer { region: ScwRegion } - export interface Platform { /** * Hostname of the host platform. @@ -528,7 +487,6 @@ export interface Platform { controlPanel?: PlatformControlPanel } - export interface BackupItemGroup { /** * Type of items (e.g., email, database, FTP). @@ -540,7 +498,6 @@ export interface BackupItemGroup { items: BackupItem[] } - export interface Backup { /** * ID of the backup. @@ -564,7 +521,6 @@ export interface Backup { totalItems: number } - export interface DatabaseUser { /** * Name of the database user. @@ -576,7 +532,6 @@ export interface DatabaseUser { databases: string[] } - export interface Database { /** * Name of the database. @@ -588,7 +543,6 @@ export interface Database { users: string[] } - export interface FtpAccount { /** * The username of the FTP account. @@ -600,7 +554,6 @@ export interface FtpAccount { path: string } - export interface HostingSummary { /** * ID of the Web Hosting plan. @@ -652,7 +605,6 @@ export interface HostingSummary { domainInfo?: HostingDomain } - export interface MailAccount { /** * Domain part of the mail account address. @@ -664,7 +616,6 @@ export interface MailAccount { username: string } - export interface ProgressSummary { /** * ID of the progress. @@ -684,7 +635,6 @@ export interface ProgressSummary { status: ProgressStatus } - export interface Website { /** * The domain of the website. @@ -700,7 +650,6 @@ export interface Website { sslStatus: boolean } - export interface DomainAvailability { /** * Fully qualified domain name (FQDN). @@ -728,7 +677,6 @@ export interface DomainAvailability { price?: Money } - export type BackupApiGetBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -744,7 +692,6 @@ export type BackupApiGetBackupRequest = { backupId: string } - export type BackupApiGetProgressRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -760,7 +707,6 @@ export type BackupApiGetProgressRequest = { progressId: string } - export type BackupApiListBackupItemsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -776,7 +722,6 @@ export type BackupApiListBackupItemsRequest = { backupId: string } - export type BackupApiListBackupsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -800,7 +745,6 @@ export type BackupApiListBackupsRequest = { orderBy?: ListBackupsRequestOrderBy } - export type BackupApiListRecentProgressesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -812,7 +756,6 @@ export type BackupApiListRecentProgressesRequest = { hostingId: string } - export type BackupApiRestoreBackupItemsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -828,7 +771,6 @@ export type BackupApiRestoreBackupItemsRequest = { itemIds?: string[] } - export type BackupApiRestoreBackupRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -844,7 +786,6 @@ export type BackupApiRestoreBackupRequest = { backupId: string } - export interface CheckFreeDomainAvailabilityResponse { /** * The free domain that was checked. @@ -860,7 +801,6 @@ export interface CheckFreeDomainAvailabilityResponse { reason?: CheckFreeDomainAvailabilityResponseUnavailableReason } - export interface CheckUserOwnsDomainResponse { /** * Indicates whether the specified project owns the domain. @@ -868,7 +808,6 @@ export interface CheckUserOwnsDomainResponse { ownsDomain: boolean } - export type ControlPanelApiListControlPanelsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -884,7 +823,6 @@ export type ControlPanelApiListControlPanelsRequest = { pageSize?: number } - export type DatabaseApiAssignDatabaseUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -904,7 +842,6 @@ export type DatabaseApiAssignDatabaseUserRequest = { username: string } - export type DatabaseApiChangeDatabaseUserPasswordRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -924,7 +861,6 @@ export type DatabaseApiChangeDatabaseUserPasswordRequest = { password: string } - export type DatabaseApiCreateDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -952,7 +888,6 @@ export type DatabaseApiCreateDatabaseRequest = { existingUsername?: string } - export type DatabaseApiCreateDatabaseUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -972,7 +907,6 @@ export type DatabaseApiCreateDatabaseUserRequest = { password: string } - export type DatabaseApiDeleteDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -988,7 +922,6 @@ export type DatabaseApiDeleteDatabaseRequest = { databaseName: string } - export type DatabaseApiDeleteDatabaseUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1004,7 +937,6 @@ export type DatabaseApiDeleteDatabaseUserRequest = { username: string } - export type DatabaseApiGetDatabaseRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1020,7 +952,6 @@ export type DatabaseApiGetDatabaseRequest = { databaseName: string } - export type DatabaseApiGetDatabaseUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1036,7 +967,6 @@ export type DatabaseApiGetDatabaseUserRequest = { username: string } - export type DatabaseApiListDatabaseUsersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1060,7 +990,6 @@ export type DatabaseApiListDatabaseUsersRequest = { orderBy?: ListDatabaseUsersRequestOrderBy } - export type DatabaseApiListDatabasesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1084,7 +1013,6 @@ export type DatabaseApiListDatabasesRequest = { orderBy?: ListDatabasesRequestOrderBy } - export type DatabaseApiUnassignDatabaseUserRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1104,7 +1032,6 @@ export type DatabaseApiUnassignDatabaseUserRequest = { username: string } - export type DnsApiCheckUserOwnsDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1120,7 +1047,6 @@ export type DnsApiCheckUserOwnsDomainRequest = { projectId?: string } - export type DnsApiGetDomainDnsRecordsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1132,7 +1058,6 @@ export type DnsApiGetDomainDnsRecordsRequest = { domain: string } - export type DnsApiGetDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1148,7 +1073,6 @@ export type DnsApiGetDomainRequest = { projectId?: string } - export type DnsApiSearchDomainsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1164,7 +1088,6 @@ export type DnsApiSearchDomainsRequest = { projectId?: string } - export type DnsApiSyncDomainDnsRecordsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1200,7 +1123,6 @@ export type DnsApiSyncDomainDnsRecordsRequest = { autoConfigDomainDns?: AutoConfigDomainDns } - export interface DnsRecords { /** * List of DNS records. @@ -1224,7 +1146,6 @@ export interface DnsRecords { autoConfigDomainDns?: AutoConfigDomainDns } - export interface Domain { /** * Name of the domain. @@ -1256,7 +1177,6 @@ export interface Domain { autoConfigDomainDns?: AutoConfigDomainDns } - export type FreeDomainApiCheckFreeDomainAvailabilityRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1272,7 +1192,6 @@ export type FreeDomainApiCheckFreeDomainAvailabilityRequest = { rootDomain: string } - export type FreeDomainApiListFreeRootDomainsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1288,7 +1207,6 @@ export type FreeDomainApiListFreeRootDomainsRequest = { pageSize?: number } - export type FtpAccountApiChangeFtpAccountPasswordRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1308,7 +1226,6 @@ export type FtpAccountApiChangeFtpAccountPasswordRequest = { password: string } - export type FtpAccountApiCreateFtpAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1332,7 +1249,6 @@ export type FtpAccountApiCreateFtpAccountRequest = { password: string } - export type FtpAccountApiListFtpAccountsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1360,7 +1276,6 @@ export type FtpAccountApiListFtpAccountsRequest = { domain?: string } - export type FtpAccountApiRemoveFtpAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1376,7 +1291,6 @@ export type FtpAccountApiRemoveFtpAccountRequest = { username: string } - export interface Hosting { /** * ID of the Web Hosting plan. @@ -1444,7 +1358,6 @@ export interface Hosting { domainInfo?: HostingDomain } - export type HostingApiAddCustomDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1460,7 +1373,6 @@ export type HostingApiAddCustomDomainRequest = { domainName: string } - export type HostingApiCreateHostingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1512,7 +1424,6 @@ export type HostingApiCreateHostingRequest = { autoConfigDomainDns?: AutoConfigDomainDns } - export type HostingApiCreateSessionRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1524,7 +1435,6 @@ export type HostingApiCreateSessionRequest = { hostingId: string } - export type HostingApiDeleteHostingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1536,7 +1446,6 @@ export type HostingApiDeleteHostingRequest = { hostingId: string } - export type HostingApiGetHostingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1548,7 +1457,6 @@ export type HostingApiGetHostingRequest = { hostingId: string } - export type HostingApiGetResourceSummaryRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1560,7 +1468,6 @@ export type HostingApiGetResourceSummaryRequest = { hostingId: string } - export type HostingApiListHostingsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1608,27 +1515,6 @@ export type HostingApiListHostingsRequest = { subdomain?: string } - -export type HostingApiMigrateControlPanelRequest = { - /** - * Region to target. If none is passed will use default region from the config. - */ - region?: ScwRegion - /** - * Hosting ID to migrate to a new control panel. - */ - hostingId: string - /** - * Control panel will migrate the hosting to a new server. - */ - controlPanelName: string - /** - * Migration. - */ - offerId: string -} - - export type HostingApiRemoveCustomDomainRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1644,7 +1530,6 @@ export type HostingApiRemoveCustomDomainRequest = { domainName: string } - export type HostingApiResetHostingPasswordRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1656,7 +1541,6 @@ export type HostingApiResetHostingPasswordRequest = { hostingId: string } - export type HostingApiUpdateHostingRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1688,7 +1572,6 @@ export type HostingApiUpdateHostingRequest = { protected?: boolean } - export interface ListBackupItemsResponse { /** * Total number of backup item groups. @@ -1700,7 +1583,6 @@ export interface ListBackupItemsResponse { groups: BackupItemGroup[] } - export interface ListBackupsResponse { /** * Total number of available backups. @@ -1712,7 +1594,6 @@ export interface ListBackupsResponse { backups: Backup[] } - export interface ListControlPanelsResponse { /** * Number of control panels returned. @@ -1724,7 +1605,6 @@ export interface ListControlPanelsResponse { controlPanels: ControlPanel[] } - export interface ListDatabaseUsersResponse { /** * Total number of database users. @@ -1736,7 +1616,6 @@ export interface ListDatabaseUsersResponse { users: DatabaseUser[] } - export interface ListDatabasesResponse { /** * Total number of databases. @@ -1748,7 +1627,6 @@ export interface ListDatabasesResponse { databases: Database[] } - export interface ListFreeRootDomainsResponse { /** * List of free root domains available for the Web Hosting. @@ -1760,7 +1638,6 @@ export interface ListFreeRootDomainsResponse { totalCount: number } - export interface ListFtpAccountsResponse { /** * Total number of FTP accounts. @@ -1772,7 +1649,6 @@ export interface ListFtpAccountsResponse { ftpAccounts: FtpAccount[] } - export interface ListHostingsResponse { /** * Number of Web Hosting plans returned. @@ -1784,7 +1660,6 @@ export interface ListHostingsResponse { hostings: HostingSummary[] } - export interface ListMailAccountsResponse { /** * Total number of mail accounts. @@ -1796,7 +1671,6 @@ export interface ListMailAccountsResponse { mailAccounts: MailAccount[] } - export interface ListOffersResponse { /** * Total number of offers. @@ -1808,7 +1682,6 @@ export interface ListOffersResponse { offers: Offer[] } - export interface ListRecentProgressesResponse { /** * List of summarized progress entries. @@ -1816,7 +1689,6 @@ export interface ListRecentProgressesResponse { progresses: ProgressSummary[] } - export interface ListWebsitesResponse { /** * Total number of websites. @@ -1828,7 +1700,6 @@ export interface ListWebsitesResponse { websites: Website[] } - export type MailAccountApiChangeMailAccountPasswordRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1852,7 +1723,6 @@ export type MailAccountApiChangeMailAccountPasswordRequest = { password: string } - export type MailAccountApiCreateMailAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1876,7 +1746,6 @@ export type MailAccountApiCreateMailAccountRequest = { password: string } - export type MailAccountApiListMailAccountsRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1904,7 +1773,6 @@ export type MailAccountApiListMailAccountsRequest = { domain?: string } - export type MailAccountApiRemoveMailAccountRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1924,7 +1792,6 @@ export type MailAccountApiRemoveMailAccountRequest = { username: string } - export type OfferApiListOffersRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -1952,7 +1819,6 @@ export type OfferApiListOffersRequest = { controlPanels?: string[] } - export interface Progress { /** * ID of the progress. @@ -1972,7 +1838,6 @@ export interface Progress { status: ProgressStatus } - export interface ResetHostingPasswordResponse { /** * @deprecated New temporary password (deprecated, use password_b64 instead). @@ -1984,7 +1849,6 @@ export interface ResetHostingPasswordResponse { oneTimePasswordB64: string } - export interface ResourceSummary { /** * Total number of active databases in the Web Hosting plan. @@ -2004,7 +1868,6 @@ export interface ResourceSummary { websitesCount: number } - export interface RestoreBackupItemsResponse { /** * Identifier used to track the item restoration progress. @@ -2012,7 +1875,6 @@ export interface RestoreBackupItemsResponse { progressId: string } - export interface RestoreBackupResponse { /** * Identifier used to track the backup restoration progress. @@ -2020,7 +1882,6 @@ export interface RestoreBackupResponse { progressId: string } - export interface SearchDomainsResponse { /** * List of domains availability. @@ -2028,7 +1889,6 @@ export interface SearchDomainsResponse { domainsAvailable: DomainAvailability[] } - export interface Session { /** * Logged user's session URL. @@ -2036,7 +1896,6 @@ export interface Session { url: string } - export type WebsiteApiCreateWebsiteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2052,7 +1911,6 @@ export type WebsiteApiCreateWebsiteRequest = { domainName: string } - export type WebsiteApiDeleteWebsiteRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2068,7 +1926,6 @@ export type WebsiteApiDeleteWebsiteRequest = { domainName: string } - export type WebsiteApiListWebsitesRequest = { /** * Region to target. If none is passed will use default region from the config. @@ -2091,5 +1948,3 @@ export type WebsiteApiListWebsitesRequest = { */ orderBy?: ListWebsitesRequestOrderBy } - - From 08dde70c4ebb506b7f4f7299f27b6821e8f64e1b Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 09:17:50 +0100 Subject: [PATCH 2/7] chore: add formatting step to format-generated command --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 3de064076..5f1adba91 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,7 @@ format-check: format-generated: pnpm install + pnpm biome format --write --config-path scripts/templates/biome.generated.json packages_generated/ pnpm biome lint --write --unsafe --config-path scripts/templates/biome.generated.json --only correctness/noUnusedImports --only correctness/noUnusedVariables packages_generated/ typing: From 494b34490c16d4c1ce5a5e3eee60c1e645696e78 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 09:50:08 +0100 Subject: [PATCH 3/7] fix: remove invalid type exports from product_catalog index --- .../product_catalog/src/v2alpha1/index.gen.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts index 8519a3fc4..a5def9dad 100644 --- a/packages_generated/product_catalog/src/v2alpha1/index.gen.ts +++ b/packages_generated/product_catalog/src/v2alpha1/index.gen.ts @@ -29,19 +29,9 @@ export type { PublicCatalogProductPropertiesHardwareRAM, PublicCatalogProductPropertiesHardwareStorage, PublicCatalogProductPropertiesInstance, - PublicCatalogProductPropertiesKeyManager, PublicCatalogProductPropertiesLoadBalancer, PublicCatalogProductPropertiesManagedInference, - PublicCatalogProductPropertiesManagedRedisDatabase, PublicCatalogProductPropertiesObjectStorage, - PublicCatalogProductPropertiesObjectStorageClassType, - PublicCatalogProductPropertiesObjectStorageClassTypeStorageClass, - PublicCatalogProductPropertiesObjectStorageInternetTrafficType, - PublicCatalogProductPropertiesObjectStorageInternetTrafficTypeTrafficType, - PublicCatalogProductPropertiesObjectStorageRegionTrafficType, - PublicCatalogProductPropertiesObjectStorageRestoreType, - PublicCatalogProductPropertiesObjectStorageRestoreTypeRestoreType, - PublicCatalogProductPropertiesSecretManager, PublicCatalogProductStatus, PublicCatalogProductUnitOfMeasure, PublicCatalogProductUnitOfMeasureCountableUnit, From 3fd391d186d37fe29d36812d376fef4e826cfbde Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 16:20:28 +0100 Subject: [PATCH 4/7] fix: remove invalid export HostingApiMigrateControlPanelRequest from webhosting --- packages_generated/webhosting/src/v1/index.gen.ts | 1 - packages_generated/webhosting/src/v1/marshalling.gen.ts | 9 --------- 2 files changed, 10 deletions(-) diff --git a/packages_generated/webhosting/src/v1/index.gen.ts b/packages_generated/webhosting/src/v1/index.gen.ts index c556acd6c..d07a695c5 100644 --- a/packages_generated/webhosting/src/v1/index.gen.ts +++ b/packages_generated/webhosting/src/v1/index.gen.ts @@ -82,7 +82,6 @@ export type { HostingApiGetHostingRequest, HostingApiGetResourceSummaryRequest, HostingApiListHostingsRequest, - HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiResetHostingPasswordRequest, HostingApiUpdateHostingRequest, diff --git a/packages_generated/webhosting/src/v1/marshalling.gen.ts b/packages_generated/webhosting/src/v1/marshalling.gen.ts index 4a4863644..82ea377cb 100644 --- a/packages_generated/webhosting/src/v1/marshalling.gen.ts +++ b/packages_generated/webhosting/src/v1/marshalling.gen.ts @@ -72,7 +72,6 @@ import type { CreateHostingRequestDomainConfiguration, OfferOptionRequest, HostingApiCreateHostingRequest, - HostingApiMigrateControlPanelRequest, HostingApiRemoveCustomDomainRequest, HostingApiUpdateHostingRequest, MailAccountApiChangeMailAccountPasswordRequest, @@ -1047,14 +1046,6 @@ export const marshalHostingApiCreateHostingRequest = ( tags: request.tags, }) -export const marshalHostingApiMigrateControlPanelRequest = ( - request: HostingApiMigrateControlPanelRequest, - defaults: DefaultValues, -): Record => ({ - control_panel_name: request.controlPanelName, - offer_id: request.offerId, -}) - export const marshalHostingApiRemoveCustomDomainRequest = ( request: HostingApiRemoveCustomDomainRequest, defaults: DefaultValues, From 4be9ef0c35b939b68fd97159c7f3f920612dd9e8 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 16:30:27 +0100 Subject: [PATCH 5/7] feat: add script to validate and fix invalid exports in generated files --- scripts/validateGeneratedExports.ts | 149 ++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 scripts/validateGeneratedExports.ts diff --git a/scripts/validateGeneratedExports.ts b/scripts/validateGeneratedExports.ts new file mode 100644 index 000000000..ec327c812 --- /dev/null +++ b/scripts/validateGeneratedExports.ts @@ -0,0 +1,149 @@ +#!/usr/bin/env tsx + +/** + * Validates and fixes invalid type exports in generated index.gen.ts files. + * Removes exports that don't exist in the corresponding types.gen.ts file. + */ + +import { readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs' +import { join } from 'node:path' + +interface ValidationResult { + file: string + removedExports: string[] + isValid: boolean +} + +async function validateExports(indexPath: string): Promise { + const typesPath = indexPath.replace('index.gen.ts', 'types.gen.ts') + const removedExports: string[] = [] + + try { + // Read index.gen.ts + const indexContent = readFileSync(indexPath, 'utf8') + const typesContent = readFileSync(typesPath, 'utf8') + + // Extract exported types from index.gen.ts + const exportTypeMatch = indexContent.match(/export type \{([^}]+)\} from/) + if (!exportTypeMatch) { + return { file: indexPath, removedExports: [], isValid: true } + } + + const exportedTypes = exportTypeMatch[1] + .split(',') + .map(t => t.trim()) + .filter(Boolean) + + // Extract all available types/interfaces from types.gen.ts + const availableTypes = new Set() + const typePattern = /export (?:type|interface) (\w+)(?:<| =| extends| \{)/g + let match: RegExpExecArray | null = typePattern.exec(typesContent) + + while (match !== null) { + availableTypes.add(match[1]) + match = typePattern.exec(typesContent) + } + + // Find invalid exports + const invalidExports: string[] = [] + for (const exportedType of exportedTypes) { + if (!availableTypes.has(exportedType)) { + invalidExports.push(exportedType) + } + } + + if (invalidExports.length === 0) { + return { file: indexPath, removedExports: [], isValid: true } + } + + // Remove invalid exports from index.gen.ts + let fixedContent = indexContent + for (const invalidExport of invalidExports) { + // Remove the invalid export from the list + const regex = new RegExp(`\\s*${invalidExport},?\\n?`, 'g') + fixedContent = fixedContent.replace(regex, '') + removedExports.push(invalidExport) + } + + // Clean up trailing commas + fixedContent = fixedContent.replace(/,(\s*})/g, '$1') + + // Write fixed content + writeFileSync(indexPath, fixedContent, 'utf8') + + return { + file: indexPath, + removedExports, + isValid: false, + } + } catch (error) { + console.error(`Error validating ${indexPath}:`, error) + return { file: indexPath, removedExports: [], isValid: true } + } +} + +function findIndexFiles(dir: string, fileList: string[] = []): string[] { + const files = readdirSync(dir) + + for (const file of files) { + const filePath = join(dir, file) + const stat = statSync(filePath) + + if (stat.isDirectory()) { + findIndexFiles(filePath, fileList) + } else if (file === 'index.gen.ts' && dir.includes('/src/')) { + fileList.push(filePath) + } + } + + return fileList +} + +async function main(): Promise { + const rootDir = process.cwd() + const packagesGeneratedDir = join(rootDir, 'packages_generated') + const indexFiles = findIndexFiles(packagesGeneratedDir) + + if (indexFiles.length === 0) { + console.log('No index.gen.ts files found') + return + } + + const results: ValidationResult[] = [] + for (const indexPath of indexFiles) { + // Skip the root index.gen.ts files (they don't export types from types.gen.ts) + if ( + indexPath.includes('/src/index.gen.ts') && + !indexPath.includes('/src/v') + ) { + continue + } + + const result = await validateExports(indexPath) + results.push(result) + } + + const invalidFiles = results.filter(r => !r.isValid) + const totalRemoved = results.reduce( + (sum, r) => sum + r.removedExports.length, + 0, + ) + + if (invalidFiles.length > 0) { + console.log( + `\n⚠️ Found ${invalidFiles.length} file(s) with invalid exports:`, + ) + for (const result of invalidFiles) { + console.log(` ${result.file}`) + console.log(` Removed: ${result.removedExports.join(', ')}`) + } + console.log(`\n✅ Fixed ${totalRemoved} invalid export(s)`) + } else { + console.log(`✅ All ${results.length} index.gen.ts files are valid`) + } +} + +main().catch(error => { + console.error(error) + process.exit(1) +}) From ba2d9d4d305e43a7674337442faa13d33a61eb62 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 16:34:16 +0100 Subject: [PATCH 6/7] feat: integrate export validation into format-generated workflow --- Makefile | 1 + package.json | 1 + 2 files changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 5f1adba91..e0db10389 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,7 @@ format-generated: pnpm install pnpm biome format --write --config-path scripts/templates/biome.generated.json packages_generated/ pnpm biome lint --write --unsafe --config-path scripts/templates/biome.generated.json --only correctness/noUnusedImports --only correctness/noUnusedVariables packages_generated/ + pnpm dlx tsx ./scripts/validateGeneratedExports.ts typing: pnpm run typecheck diff --git a/package.json b/package.json index a5fa0c206..59c666c40 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "format": "biome format --write .", "format:check": "biome format .", "format:generated": "biome check --write --linter-enabled=false packages_generated", + "validate:generated": "pnpm dlx tsx ./scripts/validateGeneratedExports.ts", "prettier": "prettier --write '**/*.{md,mdx,yml,yaml}'", "lint": "biome lint .", "check": "biome check .", From f0726a4a4af770650db6bcdfd9a1d4e54ef29d93 Mon Sep 17 00:00:00 2001 From: Jonathan Remy Date: Tue, 16 Dec 2025 16:42:42 +0100 Subject: [PATCH 7/7] fix: remove invalid exports from domain package --- .../domain/src/v2beta1/index.gen.ts | 18 +--- scripts/validateGeneratedExports.ts | 102 ++++++++++++------ 2 files changed, 72 insertions(+), 48 deletions(-) diff --git a/packages_generated/domain/src/v2beta1/index.gen.ts b/packages_generated/domain/src/v2beta1/index.gen.ts index f8f640187..8c7bc42cb 100644 --- a/packages_generated/domain/src/v2beta1/index.gen.ts +++ b/packages_generated/domain/src/v2beta1/index.gen.ts @@ -2,9 +2,7 @@ // If you have any remark or suggestion do not hesitate to open an issue. export { API, - RegistrarAPI, - UnauthenticatedRegistrarAPI, -} from './api.gen.js' + RegistrarAPI} from './api.gen.js' export * from './content.gen.js' export * from './marshalling.gen.js' export type { @@ -23,9 +21,7 @@ export type { ContactExtensionFRDunsInfo, ContactExtensionFRIndividualInfo, ContactExtensionFRMode, - ContactExtensionFRTrademarkInfo, - ContactExtensionIT, - ContactExtensionNL, + ContactExtensionFRTrademarkInfo, ContactExtensionNL, ContactExtensionNLLegalForm, ContactLegalForm, ContactQuestion, @@ -161,20 +157,16 @@ export type { RestoreDNSZoneVersionResponse, RetryInboundTransferResponse, SSLCertificate, - SSLCertificateStatus, - SearchAvailableDomainsConsoleResponse, - SearchAvailableDomainsResponse, + SSLCertificateStatus, SearchAvailableDomainsResponse, Task, TaskStatus, TaskType, Tld, TldOffer, - TransferInDomainRequestTransferRequest, - UnauthenticatedRegistrarApiSearchAvailableDomainsConsoleRequest, - UpdateContactRequestQuestion, + TransferInDomainRequestTransferRequest, UpdateContactRequestQuestion, UpdateDNSZoneNameserversRequest, UpdateDNSZoneNameserversResponse, UpdateDNSZoneRecordsRequest, UpdateDNSZoneRecordsResponse, - UpdateDNSZoneRequest, + UpdateDNSZoneRequest } from './types.gen.js' diff --git a/scripts/validateGeneratedExports.ts b/scripts/validateGeneratedExports.ts index ec327c812..8a7df9571 100644 --- a/scripts/validateGeneratedExports.ts +++ b/scripts/validateGeneratedExports.ts @@ -16,55 +16,87 @@ interface ValidationResult { async function validateExports(indexPath: string): Promise { const typesPath = indexPath.replace('index.gen.ts', 'types.gen.ts') + const apiPath = indexPath.replace('index.gen.ts', 'api.gen.ts') const removedExports: string[] = [] try { // Read index.gen.ts const indexContent = readFileSync(indexPath, 'utf8') - const typesContent = readFileSync(typesPath, 'utf8') - - // Extract exported types from index.gen.ts - const exportTypeMatch = indexContent.match(/export type \{([^}]+)\} from/) - if (!exportTypeMatch) { - return { file: indexPath, removedExports: [], isValid: true } - } - - const exportedTypes = exportTypeMatch[1] - .split(',') - .map(t => t.trim()) - .filter(Boolean) - - // Extract all available types/interfaces from types.gen.ts - const availableTypes = new Set() - const typePattern = /export (?:type|interface) (\w+)(?:<| =| extends| \{)/g - let match: RegExpExecArray | null = typePattern.exec(typesContent) + let fixedContent = indexContent - while (match !== null) { - availableTypes.add(match[1]) - match = typePattern.exec(typesContent) + // Validate API exports + const exportApiMatch = indexContent.match( + /export \{([^}]+)\} from ['"]\.\/api\.gen\.js['"]/, + ) + if (exportApiMatch) { + try { + const apiContent = readFileSync(apiPath, 'utf8') + const exportedApis = exportApiMatch[1] + .split(',') + .map(t => t.trim()) + .filter(Boolean) + + // Extract all available API classes from api.gen.ts + const availableApis = new Set() + const apiPattern = /export class (\w+) extends/g + let match: RegExpExecArray | null = apiPattern.exec(apiContent) + + while (match !== null) { + availableApis.add(match[1]) + match = apiPattern.exec(apiContent) + } + + // Find invalid API exports + for (const exportedApi of exportedApis) { + if (!availableApis.has(exportedApi)) { + const regex = new RegExp(`\\s*${exportedApi},?\\n?`, 'g') + fixedContent = fixedContent.replace(regex, '') + removedExports.push(exportedApi) + } + } + } catch { + // api.gen.ts might not exist, skip API validation + } } - // Find invalid exports - const invalidExports: string[] = [] - for (const exportedType of exportedTypes) { - if (!availableTypes.has(exportedType)) { - invalidExports.push(exportedType) + // Validate type exports + const exportTypeMatch = fixedContent.match(/export type \{([^}]+)\} from/) + if (exportTypeMatch) { + try { + const typesContent = readFileSync(typesPath, 'utf8') + const exportedTypes = exportTypeMatch[1] + .split(',') + .map(t => t.trim()) + .filter(Boolean) + + // Extract all available types/interfaces from types.gen.ts + const availableTypes = new Set() + const typePattern = + /export (?:type|interface) (\w+)(?:<| =| extends| \{)/g + let match: RegExpExecArray | null = typePattern.exec(typesContent) + + while (match !== null) { + availableTypes.add(match[1]) + match = typePattern.exec(typesContent) + } + + // Find invalid type exports + for (const exportedType of exportedTypes) { + if (!availableTypes.has(exportedType)) { + const regex = new RegExp(`\\s*${exportedType},?\\n?`, 'g') + fixedContent = fixedContent.replace(regex, '') + removedExports.push(exportedType) + } + } + } catch { + // types.gen.ts might not exist, skip type validation } } - if (invalidExports.length === 0) { + if (removedExports.length === 0) { return { file: indexPath, removedExports: [], isValid: true } } - // Remove invalid exports from index.gen.ts - let fixedContent = indexContent - for (const invalidExport of invalidExports) { - // Remove the invalid export from the list - const regex = new RegExp(`\\s*${invalidExport},?\\n?`, 'g') - fixedContent = fixedContent.replace(regex, '') - removedExports.push(invalidExport) - } - // Clean up trailing commas fixedContent = fixedContent.replace(/,(\s*})/g, '$1')