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
12 changes: 12 additions & 0 deletions packages/clients/src/api/ipam/v1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import type { Region } from '../../../bridge'
import {
marshalBookIPRequest,
marshalReleaseIPSetRequest,
marshalUpdateIPRequest,
unmarshalIP,
unmarshalListIPsResponse,
Expand All @@ -21,6 +22,7 @@ import type {
ListIPsRequest,
ListIPsResponse,
ReleaseIPRequest,
ReleaseIPSetRequest,
UpdateIPRequest,
} from './types.gen'

Expand Down Expand Up @@ -72,6 +74,16 @@ export class API extends ParentAPI {
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ips/${validatePathParam('ipId', request.ipId)}`,
})

releaseIPSet = (request: Readonly<ReleaseIPSetRequest> = {}) =>
this.client.fetch<void>({
body: JSON.stringify(
marshalReleaseIPSetRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'POST',
path: `/ipam/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/ip-sets/release`,
})

/**
* Get an IP. Retrieve details of an existing IP, specified by its IP ID.
*
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/ipam/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export type {
ListIPsRequestOrderBy,
ListIPsResponse,
ReleaseIPRequest,
ReleaseIPSetRequest,
Resource,
ResourceType,
Reverse,
Expand Down
8 changes: 8 additions & 0 deletions packages/clients/src/api/ipam/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type {
BookIPRequest,
IP,
ListIPsResponse,
ReleaseIPSetRequest,
Resource,
Reverse,
Source,
Expand Down Expand Up @@ -117,6 +118,13 @@ export const marshalBookIPRequest = (
tags: request.tags,
})

export const marshalReleaseIPSetRequest = (
request: ReleaseIPSetRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
ip_ids: request.ipIds,
})

const marshalReverse = (
request: Reverse,
defaults: DefaultValues,
Expand Down
9 changes: 9 additions & 0 deletions packages/clients/src/api/ipam/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ export type ReleaseIPRequest = {
ipId: string
}

export type ReleaseIPSetRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
ipIds?: string[]
}

export type UpdateIPRequest = {
/**
* Region to target. If none is passed will use default region from the
Expand Down
1 change: 1 addition & 0 deletions packages/clients/src/api/rdb/v1/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export type {
DeleteReadReplicaRequest,
DeleteSnapshotRequest,
DeleteUserRequest,
EncryptionAtRest,
Endpoint,
EndpointDirectAccessDetails,
EndpointLoadBalancerDetails,
Expand Down
27 changes: 27 additions & 0 deletions packages/clients/src/api/rdb/v1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import type {
DeleteInstanceACLRulesResponse,
DeleteInstanceSettingsRequest,
DeleteInstanceSettingsResponse,
EncryptionAtRest,
Endpoint,
EndpointDirectAccessDetails,
EndpointLoadBalancerDetails,
Expand Down Expand Up @@ -267,6 +268,18 @@ export const unmarshalBackupSchedule = (data: unknown): BackupSchedule => {
} as BackupSchedule
}

const unmarshalEncryptionAtRest = (data: unknown): EncryptionAtRest => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'EncryptionAtRest' failed as data isn't a dictionary.`,
)
}

return {
enabled: data.enabled,
} as EncryptionAtRest
}

const unmarshalInstanceSetting = (data: unknown): InstanceSetting => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand Down Expand Up @@ -335,6 +348,9 @@ export const unmarshalInstance = (data: unknown): Instance => {
? unmarshalBackupSchedule(data.backup_schedule)
: undefined,
createdAt: unmarshalDate(data.created_at),
encryption: data.encryption
? unmarshalEncryptionAtRest(data.encryption)
: undefined,
endpoint: data.endpoint ? unmarshalEndpoint(data.endpoint) : undefined,
endpoints: unmarshalArrayOfObject(data.endpoints, unmarshalEndpoint),
engine: data.engine,
Expand Down Expand Up @@ -1002,12 +1018,23 @@ export const marshalCreateInstanceFromSnapshotRequest = (
node_type: request.nodeType,
})

const marshalEncryptionAtRest = (
request: EncryptionAtRest,
defaults: DefaultValues,
): Record<string, unknown> => ({
enabled: request.enabled,
})

export const marshalCreateInstanceRequest = (
request: CreateInstanceRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
backup_same_region: request.backupSameRegion,
disable_backup: request.disableBackup,
encryption:
request.encryption !== undefined
? marshalEncryptionAtRest(request.encryption, defaults)
: undefined,
engine: request.engine,
init_endpoints:
request.initEndpoints !== undefined
Expand Down
8 changes: 8 additions & 0 deletions packages/clients/src/api/rdb/v1/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ export interface BackupSchedule {
nextRunAt?: Date
}

export interface EncryptionAtRest {
enabled: boolean
}

export interface InstanceSetting {
name: string
value: string
Expand Down Expand Up @@ -554,6 +558,8 @@ export interface Instance {
backupSameRegion: boolean
/** List of Database Instance maintenance events. */
maintenances: Maintenance[]
/** Encryption at rest settings for your Database Instance. */
encryption?: EncryptionAtRest
}

export interface NodeType {
Expand Down Expand Up @@ -820,6 +826,8 @@ export type CreateInstanceRequest = {
* the Database Instance.
*/
backupSameRegion: boolean
/** Encryption at rest settings for your Database Instance. */
encryption?: EncryptionAtRest
}

export type CreateReadReplicaEndpointRequest = {
Expand Down