Skip to content

Commit

Permalink
Merge branch 'main' into v1.5905.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Dec 24, 2024
2 parents 5e70347 + 5a3468a commit 90492b7
Show file tree
Hide file tree
Showing 11 changed files with 122 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +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 { ServerStatus } from './types.gen'
import type { ServerPrivateNetworkStatus, ServerStatus } from './types.gen'

/** Lists transient statutes of the enum {@link ServerPrivateNetworkStatus}. */
export const SERVER_PRIVATE_NETWORK_TRANSIENT_STATUSES: ServerPrivateNetworkStatus[] =
['vpc_updating']

/** Lists transient statutes of the enum {@link ServerStatus}. */
export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ export const unmarshalServer = (data: unknown): Server => {
updatedAt: unmarshalDate(data.updated_at),
vncPort: data.vnc_port,
vncUrl: data.vnc_url,
vpcStatus: data.vpc_status,
zone: data.zone,
} as Server
}
Expand Down Expand Up @@ -263,6 +264,7 @@ export const marshalCreateServerRequest = (
request: CreateServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
enable_vpc: request.enableVpc,
name: request.name || randomName('as'),
os_id: request.osId,
project_id: request.projectId ?? defaults.defaultProjectId,
Expand All @@ -287,6 +289,7 @@ export const marshalUpdateServerRequest = (
request: UpdateServerRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
enable_vpc: request.enableVpc,
name: request.name,
schedule_deletion: request.scheduleDeletion,
})
18 changes: 18 additions & 0 deletions packages/clients/src/api/applesilicon/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ export type ConnectivityDiagnosticDiagnosticStatus =

export type ListServersRequestOrderBy = 'created_at_asc' | 'created_at_desc'

export type ServerPrivateNetworkStatus =
| 'vpc_unknown_status'
| 'vpc_enabled'
| 'vpc_updating'
| 'vpc_disabled'

export type ServerStatus =
| 'unknown_status'
| 'starting'
Expand Down Expand Up @@ -158,6 +164,11 @@ export interface Server {
* using the server status.
*/
delivered: boolean
/**
* Activation status of optional Private Network feature support for this
* server.
*/
vpcStatus: ServerPrivateNetworkStatus
}

export interface ConnectivityDiagnostic {
Expand All @@ -184,6 +195,11 @@ export type CreateServerRequest = {
* induce an extended delivery time.
*/
osId?: string
/**
* Activate the Private Network feature for this server. This feature is
* configured through the Apple Silicon - Private Networks API.
*/
enableVpc: boolean
}

export type DeleteServerRequest = {
Expand Down Expand Up @@ -319,4 +335,6 @@ export type UpdateServerRequest = {
name?: string
/** Specify whether the server should be flagged for automatic deletion. */
scheduleDeletion?: boolean
/** Activate or deactivate Private Network support for this server. */
enableVpc?: boolean
}
1 change: 1 addition & 0 deletions packages/clients/src/api/ipam/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export class API extends ParentAPI {
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips`,
urlParams: urlParams(
['attached', request.attached],
['ip_ids', request.ipIds],
['is_ipv6', request.isIpv6],
['mac_address', request.macAddress],
['order_by', request.orderBy],
Expand Down
22 changes: 12 additions & 10 deletions packages/clients/src/api/ipam/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ export type ListIPsRequest = {
vpcId?: string
/** Defines whether to filter only for IPs which are attached to a resource. */
attached?: boolean
/**
* Attached resource name to filter for, only IPs attached to a resource with
* this string within their name will be returned.
*/
resourceName?: string
/**
* Resource ID to filter for. Only IPs attached to this resource will be
* returned.
Expand All @@ -240,6 +245,11 @@ export type ListIPsRequest = {
* will be returned.
*/
resourceType?: ResourceType
/**
* Resource types to filter for. Only IPs attached to these types of resources
* will be returned.
*/
resourceTypes?: ResourceType[]
/**
* MAC address to filter for. Only IPs attached to a resource with this MAC
* address will be returned.
Expand All @@ -257,16 +267,8 @@ export type ListIPsRequest = {
organizationId?: string
/** Defines whether to filter only for IPv4s or IPv6s. */
isIpv6?: boolean
/**
* Attached resource name to filter for, only IPs attached to a resource with
* this string within their name will be returned.
*/
resourceName?: string
/**
* Resource types to filter for. Only IPs attached to these types of resources
* will be returned.
*/
resourceTypes?: ResourceType[]
/** IP IDs to filter for. Only IPs with these UUIDs will be returned. */
ipIds?: string[]
}

export interface ListIPsResponse {
Expand Down
12 changes: 6 additions & 6 deletions packages/clients/src/api/lb/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ export interface HealthCheck {
*/
tcpConfig?: HealthCheckTcpConfig
/**
* Object to configure a MySQL health check. The check requires MySQL >=3.22,
* for older versions, use a TCP health check.
* Object to configure a MySQL health check. The check requires MySQL >=3.22
* or <9.0. For older or newer versions, use a TCP health check.
*
* One-of ('config'): at most one of 'tcpConfig', 'mysqlConfig',
* 'pgsqlConfig', 'ldapConfig', 'redisConfig', 'httpConfig', 'httpsConfig'
Expand Down Expand Up @@ -1848,8 +1848,8 @@ export type UpdateHealthCheckRequest = {
*/
tcpConfig?: HealthCheckTcpConfig
/**
* Object to configure a MySQL health check. The check requires MySQL >=3.22,
* for older versions, use a TCP health check.
* Object to configure a MySQL health check. The check requires MySQL >=3.22
* or <9.0. For older or newer versions, use a TCP health check.
*
* One-of ('config'): at most one of 'tcpConfig', 'mysqlConfig',
* 'pgsqlConfig', 'ldapConfig', 'redisConfig', 'httpConfig', 'httpsConfig'
Expand Down Expand Up @@ -2864,8 +2864,8 @@ export type ZonedApiUpdateHealthCheckRequest = {
*/
tcpConfig?: HealthCheckTcpConfig
/**
* Object to configure a MySQL health check. The check requires MySQL >=3.22,
* for older versions, use a TCP health check.
* Object to configure a MySQL health check. The check requires MySQL >=3.22
* or <9.0. For older or newer versions, use a TCP health check.
*
* One-of ('config'): at most one of 'tcpConfig', 'mysqlConfig',
* 'pgsqlConfig', 'ldapConfig', 'redisConfig', 'httpConfig', 'httpsConfig'
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/secret/v1beta1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions packages/clients/src/api/secret/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
26 changes: 26 additions & 0 deletions packages/clients/src/api/webhosting/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
marshalDatabaseApiCreateDatabaseUserRequest,
marshalDatabaseApiUnassignDatabaseUserRequest,
marshalDnsApiCheckUserOwnsDomainRequest,
marshalDnsApiSyncDomainDnsRecordsRequest,
marshalFtpAccountApiChangeFtpAccountPasswordRequest,
marshalFtpAccountApiCreateFtpAccountRequest,
marshalHostingApiCreateHostingRequest,
Expand Down Expand Up @@ -60,6 +61,7 @@ import type {
DatabaseUser,
DnsApiCheckUserOwnsDomainRequest,
DnsApiGetDomainDnsRecordsRequest,
DnsApiSyncDomainDnsRecordsRequest,
DnsRecords,
FtpAccount,
FtpAccountApiChangeFtpAccountPasswordRequest,
Expand Down Expand Up @@ -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<DnsApiSyncDomainDnsRecordsRequest>,
) =>
this.client.fetch<DnsRecords>(
{
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,
)
}

/**
Expand Down
25 changes: 25 additions & 0 deletions packages/clients/src/api/webhosting/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
DatabaseApiUnassignDatabaseUserRequest,
DatabaseUser,
DnsApiCheckUserOwnsDomainRequest,
DnsApiSyncDomainDnsRecordsRequest,
DnsRecord,
DnsRecords,
FtpAccount,
Expand Down Expand Up @@ -53,6 +54,7 @@ import type {
ResetHostingPasswordResponse,
ResourceSummary,
Session,
SyncDomainDnsRecordsRequestRecord,
Website,
} from './types.gen'

Expand Down Expand Up @@ -568,6 +570,29 @@ export const marshalDnsApiCheckUserOwnsDomainRequest = (
project_id: request.projectId ?? defaults.defaultProjectId,
})

const marshalSyncDomainDnsRecordsRequestRecord = (
request: SyncDomainDnsRecordsRequestRecord,
defaults: DefaultValues,
): Record<string, unknown> => ({
name: request.name,
type: request.type,
})

export const marshalDnsApiSyncDomainDnsRecordsRequest = (
request: DnsApiSyncDomainDnsRecordsRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
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,
Expand Down
23 changes: 23 additions & 0 deletions packages/clients/src/api/webhosting/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ export interface OfferOptionRequest {
quantity: number
}

export interface SyncDomainDnsRecordsRequestRecord {
name: string
type: DnsRecordType
}

export interface DnsRecord {
/** Record name. */
name: string
Expand Down Expand Up @@ -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[]
Expand Down

0 comments on commit 90492b7

Please sign in to comment.