diff --git a/packages/clients/src/api/tem/v1alpha1/api.gen.ts b/packages/clients/src/api/tem/v1alpha1/api.gen.ts index 559f89924..6bda73e87 100644 --- a/packages/clients/src/api/tem/v1alpha1/api.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/api.gen.ts @@ -16,6 +16,7 @@ import { marshalCreateDomainRequest, marshalCreateEmailRequest, marshalCreateWebhookRequest, + marshalUpdateDomainRequest, marshalUpdateWebhookRequest, unmarshalCreateEmailResponse, unmarshalDomain, @@ -54,6 +55,7 @@ import type { ListWebhooksResponse, RevokeDomainRequest, Statistics, + UpdateDomainRequest, UpdateWebhookRequest, Webhook, } from './types.gen' @@ -355,6 +357,25 @@ export class API extends ParentAPI { unmarshalDomainLastStatus, ) + /** + * Update a domain. Update a domain auto-configuration. + * + * @param request - The request {@link UpdateDomainRequest} + * @returns A Promise of Domain + */ + updateDomain = (request: Readonly) => + this.client.fetch( + { + body: JSON.stringify( + marshalUpdateDomainRequest(request, this.client.settings), + ), + headers: jsonContentHeaders, + method: 'PATCH', + path: `/transactional-email/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/domains/${validatePathParam('domainId', request.domainId)}`, + }, + unmarshalDomain, + ) + /** * Create a Webhook. Create a new Webhook triggered by a list of event types * and pushed to a Scaleway SNS ARN. diff --git a/packages/clients/src/api/tem/v1alpha1/index.gen.ts b/packages/clients/src/api/tem/v1alpha1/index.gen.ts index 641c49a2d..25868146e 100644 --- a/packages/clients/src/api/tem/v1alpha1/index.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/index.gen.ts @@ -48,6 +48,7 @@ export type { ListWebhooksResponse, RevokeDomainRequest, Statistics, + UpdateDomainRequest, UpdateWebhookRequest, Webhook, WebhookEvent, diff --git a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts index b98ccaf74..915f27137 100644 --- a/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts @@ -30,6 +30,7 @@ import type { ListWebhookEventsResponse, ListWebhooksResponse, Statistics, + UpdateDomainRequest, UpdateWebhookRequest, Webhook, WebhookEvent, @@ -453,6 +454,13 @@ export const marshalCreateWebhookRequest = ( sns_arn: request.snsArn, }) +export const marshalUpdateDomainRequest = ( + request: UpdateDomainRequest, + defaults: DefaultValues, +): Record => ({ + autoconfig: request.autoconfig, +}) + export const marshalUpdateWebhookRequest = ( request: UpdateWebhookRequest, defaults: DefaultValues, diff --git a/packages/clients/src/api/tem/v1alpha1/types.gen.ts b/packages/clients/src/api/tem/v1alpha1/types.gen.ts index 6eb36ebe4..299c5e160 100644 --- a/packages/clients/src/api/tem/v1alpha1/types.gen.ts +++ b/packages/clients/src/api/tem/v1alpha1/types.gen.ts @@ -652,6 +652,21 @@ export interface Statistics { canceledCount: number } +export type UpdateDomainRequest = { + /** + * Region to target. If none is passed will use default region from the + * config. + */ + region?: Region + /** ID of the domain to update. */ + domainId: string + /** + * (Optional) If set to true, activate auto-configuration of the domain's DNS + * zone. + */ + autoconfig?: boolean +} + export type UpdateWebhookRequest = { /** * Region to target. If none is passed will use default region from the