From 89a670f91308a7db1afa9b37a28b6217563faea4 Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Fri, 15 Mar 2024 10:08:34 +0000 Subject: [PATCH] feat: update generated APIs --- .../clients/src/api/tem/v1alpha1/index.gen.ts | 2 ++ .../src/api/tem/v1alpha1/marshalling.gen.ts | 28 +++++++++++++++++++ .../clients/src/api/tem/v1alpha1/types.gen.ts | 14 ++++++++++ 3 files changed, 44 insertions(+) diff --git a/packages/clients/src/api/tem/v1alpha1/index.gen.ts b/packages/clients/src/api/tem/v1alpha1/index.gen.ts index 56cd0e6a2..2db4a8b54 100644 --- a/packages/clients/src/api/tem/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/index.gen.ts @@ -17,6 +17,8 @@ export type { DomainLastStatusDmarcRecord, DomainLastStatusRecordStatus, DomainLastStatusSpfRecord, + DomainRecords, + DomainRecordsDMARC, DomainReputation, DomainReputationStatus, DomainStatistics, diff --git a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts index 019743ce0..ce1e62e57 100644 --- a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts @@ -18,6 +18,8 @@ import type { DomainLastStatusDkimRecord, DomainLastStatusDmarcRecord, DomainLastStatusSpfRecord, + DomainRecords, + DomainRecordsDMARC, DomainReputation, DomainStatistics, Email, @@ -68,6 +70,31 @@ export const unmarshalEmail = (data: unknown): Email => { } as Email } +const unmarshalDomainRecordsDMARC = (data: unknown): DomainRecordsDMARC => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecordsDMARC' failed as data isn't a dictionary.`, + ) + } + + return { + name: data.name, + value: data.value, + } as DomainRecordsDMARC +} + +const unmarshalDomainRecords = (data: unknown): DomainRecords => { + if (!isJSONObject(data)) { + throw new TypeError( + `Unmarshalling the type 'DomainRecords' failed as data isn't a dictionary.`, + ) + } + + return { + dmarc: data.dmarc ? unmarshalDomainRecordsDMARC(data.dmarc) : undefined, + } as DomainRecords +} + const unmarshalDomainReputation = (data: unknown): DomainReputation => { if (!isJSONObject(data)) { throw new TypeError( @@ -116,6 +143,7 @@ export const unmarshalDomain = (data: unknown): Domain => { nextCheckAt: unmarshalDate(data.next_check_at), organizationId: data.organization_id, projectId: data.project_id, + records: data.records ? unmarshalDomainRecords(data.records) : undefined, region: data.region, reputation: data.reputation ? unmarshalDomainReputation(data.reputation) diff --git a/packages/clients/src/api/tem/v1alpha1/types.gen.ts b/packages/clients/src/api/tem/v1alpha1/types.gen.ts index db30b29d1..f24c0a51a 100644 --- a/packages/clients/src/api/tem/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/types.gen.ts @@ -58,6 +58,13 @@ export type ListEmailsRequestOrderBy = | 'subject_desc' | 'subject_asc' +export interface DomainRecordsDMARC { + /** Name of the DMARC TXT record. */ + name: string + /** Value of the DMARC TXT record. */ + value: string +} + export interface EmailTry { /** Rank number of this attempt to send the email. */ rank: number @@ -75,6 +82,11 @@ export interface EmailTry { message: string } +export interface DomainRecords { + /** DMARC TXT record specification. */ + dmarc?: DomainRecordsDMARC +} + export interface DomainReputation { /** Status of your domain's reputation. */ status: DomainReputationStatus @@ -217,6 +229,8 @@ export interface Domain { * sent enough emails. */ reputation?: DomainReputation + /** List of records to configure to validate a domain. */ + records?: DomainRecords /** * Region to target. If none is passed will use default region from the * config.