Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/clients/src/api/tem/v1alpha1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
marshalCreateDomainRequest,
marshalCreateEmailRequest,
marshalCreateWebhookRequest,
marshalUpdateDomainRequest,
marshalUpdateWebhookRequest,
unmarshalCreateEmailResponse,
unmarshalDomain,
Expand Down Expand Up @@ -54,6 +55,7 @@ import type {
ListWebhooksResponse,
RevokeDomainRequest,
Statistics,
UpdateDomainRequest,
UpdateWebhookRequest,
Webhook,
} from './types.gen'
Expand Down Expand Up @@ -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<UpdateDomainRequest>) =>
this.client.fetch<Domain>(
{
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.
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/tem/v1alpha1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export type {
ListWebhooksResponse,
RevokeDomainRequest,
Statistics,
UpdateDomainRequest,
UpdateWebhookRequest,
Webhook,
WebhookEvent,
Expand Down
8 changes: 8 additions & 0 deletions packages/clients/src/api/tem/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type {
ListWebhookEventsResponse,
ListWebhooksResponse,
Statistics,
UpdateDomainRequest,
UpdateWebhookRequest,
Webhook,
WebhookEvent,
Expand Down Expand Up @@ -453,6 +454,13 @@ export const marshalCreateWebhookRequest = (
sns_arn: request.snsArn,
})

export const marshalUpdateDomainRequest = (
request: UpdateDomainRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
autoconfig: request.autoconfig,
})

export const marshalUpdateWebhookRequest = (
request: UpdateWebhookRequest,
defaults: DefaultValues,
Expand Down
15 changes: 15 additions & 0 deletions packages/clients/src/api/tem/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down