From 47e291cde3e77548302235538a1d20cb2db21079 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Wed, 18 Dec 2024 15:10:31 +0000 Subject: [PATCH] feat: update generated APIs --- .../api/applesilicon/v1alpha1/index.gen.ts | 1 + packages/clients/src/api/index.gen.ts | 2 + .../clients/src/api/interlink/index.gen.ts | 6 +++ .../src/api/interlink/v1beta1/index.gen.ts | 40 +++++++++++++++++++ .../src/api/secret/v1beta1/marshalling.gen.ts | 1 + .../src/api/secret/v1beta1/types.gen.ts | 2 + .../clients/src/api/webhosting/v1/api.gen.ts | 26 ++++++++++++ .../src/api/webhosting/v1/index.gen.ts | 2 + .../src/api/webhosting/v1/marshalling.gen.ts | 25 ++++++++++++ .../src/api/webhosting/v1/types.gen.ts | 23 +++++++++++ 10 files changed, 128 insertions(+) create mode 100644 packages/clients/src/api/interlink/index.gen.ts create mode 100644 packages/clients/src/api/interlink/v1beta1/index.gen.ts diff --git a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts index f963a33d7..71e4a9920 100644 --- a/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/applesilicon/v1alpha1/index.gen.ts @@ -24,6 +24,7 @@ export type { RebootServerRequest, ReinstallServerRequest, Server, + ServerPrivateNetworkStatus, ServerStatus, ServerType, ServerTypeCPU, diff --git a/packages/clients/src/api/index.gen.ts b/packages/clients/src/api/index.gen.ts index f1ea4aea0..b4c0be94c 100644 --- a/packages/clients/src/api/index.gen.ts +++ b/packages/clients/src/api/index.gen.ts @@ -20,6 +20,7 @@ import * as Function from './function/index.gen' import * as Iam from './iam/index.gen' import * as Inference from './inference/index.gen' import * as Instance from './instance/index.gen' +import * as Interlink from './interlink/index.gen' import * as Iot from './iot/index.gen' import * as Ipam from './ipam/index.gen' import * as Ipfs from './ipfs/index.gen' @@ -62,6 +63,7 @@ export { Iam, Inference, Instance, + Interlink, Iot, Ipam, Ipfs, diff --git a/packages/clients/src/api/interlink/index.gen.ts b/packages/clients/src/api/interlink/index.gen.ts new file mode 100644 index 000000000..886270369 --- /dev/null +++ b/packages/clients/src/api/interlink/index.gen.ts @@ -0,0 +1,6 @@ +/** + * This file is automatically generated from /scripts/generate.js PLEASE DO NOT + * EDIT HERE + */ + +export * as v1beta1 from './v1beta1/index.gen' diff --git a/packages/clients/src/api/interlink/v1beta1/index.gen.ts b/packages/clients/src/api/interlink/v1beta1/index.gen.ts new file mode 100644 index 000000000..710cd67c6 --- /dev/null +++ b/packages/clients/src/api/interlink/v1beta1/index.gen.ts @@ -0,0 +1,40 @@ +// 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' +export type { + AttachRoutingPolicyRequest, + AttachVpcRequest, + BgpStatus, + CreateLinkRequest, + CreateRoutingPolicyRequest, + DeleteLinkRequest, + DeleteRoutingPolicyRequest, + DetachRoutingPolicyRequest, + DetachVpcRequest, + DisableRoutePropagationRequest, + EnableRoutePropagationRequest, + GetLinkRequest, + GetPartnerRequest, + GetPopRequest, + GetRoutingPolicyRequest, + Link, + LinkStatus, + ListLinksRequest, + ListLinksRequestOrderBy, + ListLinksResponse, + ListPartnersRequest, + ListPartnersRequestOrderBy, + ListPartnersResponse, + ListPopsRequest, + ListPopsRequestOrderBy, + ListPopsResponse, + ListRoutingPoliciesRequest, + ListRoutingPoliciesRequestOrderBy, + ListRoutingPoliciesResponse, + Partner, + Pop, + RoutingPolicy, + UpdateLinkRequest, + UpdateRoutingPolicyRequest, +} from './types.gen' +export * as ValidationRules from './validation-rules.gen' diff --git a/packages/clients/src/api/secret/v1beta1/marshalling.gen.ts b/packages/clients/src/api/secret/v1beta1/marshalling.gen.ts index 565e1cc93..4b308fd56 100644 --- a/packages/clients/src/api/secret/v1beta1/marshalling.gen.ts +++ b/packages/clients/src/api/secret/v1beta1/marshalling.gen.ts @@ -50,6 +50,7 @@ export const unmarshalSecretVersion = (data: unknown): SecretVersion => { return { createdAt: unmarshalDate(data.created_at), + deletedAt: unmarshalDate(data.deleted_at), description: data.description, ephemeralProperties: data.ephemeral_properties ? unmarshalEphemeralProperties(data.ephemeral_properties) diff --git a/packages/clients/src/api/secret/v1beta1/types.gen.ts b/packages/clients/src/api/secret/v1beta1/types.gen.ts index 854686c50..8bac2b849 100644 --- a/packages/clients/src/api/secret/v1beta1/types.gen.ts +++ b/packages/clients/src/api/secret/v1beta1/types.gen.ts @@ -103,6 +103,8 @@ export interface SecretVersion { createdAt?: Date /** Last update of the version. */ updatedAt?: Date + /** Date and time of the version's deletion. */ + deletedAt?: Date /** Description of the version. */ description?: string /** Returns `true` if the version is the latest. */ diff --git a/packages/clients/src/api/webhosting/v1/api.gen.ts b/packages/clients/src/api/webhosting/v1/api.gen.ts index c443046dc..9b75cb5d5 100644 --- a/packages/clients/src/api/webhosting/v1/api.gen.ts +++ b/packages/clients/src/api/webhosting/v1/api.gen.ts @@ -16,6 +16,7 @@ import { marshalDatabaseApiCreateDatabaseUserRequest, marshalDatabaseApiUnassignDatabaseUserRequest, marshalDnsApiCheckUserOwnsDomainRequest, + marshalDnsApiSyncDomainDnsRecordsRequest, marshalFtpAccountApiChangeFtpAccountPasswordRequest, marshalFtpAccountApiCreateFtpAccountRequest, marshalHostingApiCreateHostingRequest, @@ -60,6 +61,7 @@ import type { DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiGetDomainDnsRecordsRequest, + DnsApiSyncDomainDnsRecordsRequest, DnsRecords, FtpAccount, FtpAccountApiChangeFtpAccountPasswordRequest, @@ -433,6 +435,30 @@ export class DnsAPI extends ParentAPI { }, unmarshalCheckUserOwnsDomainResponse, ) + + /** + * "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, + ) => + this.client.fetch( + { + body: JSON.stringify( + marshalDnsApiSyncDomainDnsRecordsRequest( + request, + this.client.settings, + ), + ), + headers: jsonContentHeaders, + method: 'POST', + path: `/webhosting/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domain', request.domain)}/sync-domain-dns-records`, + }, + unmarshalDnsRecords, + ) } /** diff --git a/packages/clients/src/api/webhosting/v1/index.gen.ts b/packages/clients/src/api/webhosting/v1/index.gen.ts index 9f1ef58ea..f82f79689 100644 --- a/packages/clients/src/api/webhosting/v1/index.gen.ts +++ b/packages/clients/src/api/webhosting/v1/index.gen.ts @@ -32,6 +32,7 @@ export type { DatabaseUser, DnsApiCheckUserOwnsDomainRequest, DnsApiGetDomainDnsRecordsRequest, + DnsApiSyncDomainDnsRecordsRequest, DnsRecord, DnsRecordStatus, DnsRecordType, @@ -90,6 +91,7 @@ export type { ResetHostingPasswordResponse, ResourceSummary, Session, + SyncDomainDnsRecordsRequestRecord, Website, WebsiteApiListWebsitesRequest, } from './types.gen' diff --git a/packages/clients/src/api/webhosting/v1/marshalling.gen.ts b/packages/clients/src/api/webhosting/v1/marshalling.gen.ts index 3f531f36d..0b93660f4 100644 --- a/packages/clients/src/api/webhosting/v1/marshalling.gen.ts +++ b/packages/clients/src/api/webhosting/v1/marshalling.gen.ts @@ -21,6 +21,7 @@ import type { DatabaseApiUnassignDatabaseUserRequest, DatabaseUser, DnsApiCheckUserOwnsDomainRequest, + DnsApiSyncDomainDnsRecordsRequest, DnsRecord, DnsRecords, FtpAccount, @@ -53,6 +54,7 @@ import type { ResetHostingPasswordResponse, ResourceSummary, Session, + SyncDomainDnsRecordsRequestRecord, Website, } from './types.gen' @@ -568,6 +570,29 @@ export const marshalDnsApiCheckUserOwnsDomainRequest = ( project_id: request.projectId ?? defaults.defaultProjectId, }) +const marshalSyncDomainDnsRecordsRequestRecord = ( + request: SyncDomainDnsRecordsRequestRecord, + defaults: DefaultValues, +): Record => ({ + name: request.name, + type: request.type, +}) + +export const marshalDnsApiSyncDomainDnsRecordsRequest = ( + request: DnsApiSyncDomainDnsRecordsRequest, + defaults: DefaultValues, +): Record => ({ + custom_records: + request.customRecords !== undefined + ? request.customRecords.map(elt => + marshalSyncDomainDnsRecordsRequestRecord(elt, defaults), + ) + : undefined, + update_all_records: request.updateAllRecords, + update_mail_records: request.updateMailRecords, + update_web_records: request.updateWebRecords, +}) + export const marshalFtpAccountApiChangeFtpAccountPasswordRequest = ( request: FtpAccountApiChangeFtpAccountPasswordRequest, defaults: DefaultValues, diff --git a/packages/clients/src/api/webhosting/v1/types.gen.ts b/packages/clients/src/api/webhosting/v1/types.gen.ts index b6e6e2fae..5ad3bf999 100644 --- a/packages/clients/src/api/webhosting/v1/types.gen.ts +++ b/packages/clients/src/api/webhosting/v1/types.gen.ts @@ -125,6 +125,11 @@ export interface OfferOptionRequest { quantity: number } +export interface SyncDomainDnsRecordsRequestRecord { + name: string + type: DnsRecordType +} + export interface DnsRecord { /** Record name. */ name: string @@ -475,6 +480,24 @@ export type DnsApiGetDomainDnsRecordsRequest = { domain: string } +export type DnsApiSyncDomainDnsRecordsRequest = { + /** + * Region to target. If none is passed will use default region from the + * config. + */ + region?: Region + /** Domain for which the DNS records will be synchronized. */ + domain: string + /** Whether or not to synchronize the web records. */ + updateWebRecords: boolean + /** Whether or not to synchronize the mail records. */ + updateMailRecords: boolean + /** Whether or not to synchronize all types of records. This one has priority. */ + updateAllRecords: boolean + /** Custom records to synchronize. */ + customRecords?: SyncDomainDnsRecordsRequestRecord[] +} + export interface DnsRecords { /** List of DNS records. */ records: DnsRecord[]