Skip to content

Commit dcbedb5

Browse files
committed
feat: update generated APIs
1 parent 8768d24 commit dcbedb5

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

packages_generated/mongodb/src/v1alpha1/api.gen.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import {
77
validatePathParam,
88
waitForResource,
99
} from '@scaleway/sdk-client'
10-
import type { Region as ScwRegion, WaitForOptions } from '@scaleway/sdk-client'
10+
import type { WaitForOptions } from '@scaleway/sdk-client'
11+
import type { ApiLocality } from '../types/locality'
12+
import { toApiLocality } from '../types/locality'
1113
import {
1214
INSTANCE_TRANSIENT_STATUSES as INSTANCE_TRANSIENT_STATUSES_MONGODB,
1315
SNAPSHOT_TRANSIENT_STATUSES as SNAPSHOT_TRANSIENT_STATUSES_MONGODB,
@@ -77,8 +79,13 @@ const jsonContentHeaders = {
7779
This API allows you to manage your Managed Databases for MongoDB®.
7880
*/
7981
export class API extends ParentAPI {
80-
/** Lists the available regions of the API. */
81-
public static readonly LOCALITIES: ScwRegion[] = ['fr-par']
82+
/**
83+
* Locality of this API.
84+
* type ∈ {'zone','region','global','unspecified'}
85+
*/
86+
public static readonly LOCALITY: ApiLocality = toApiLocality({
87+
regions: ['fr-par'],
88+
})
8289

8390
protected pageOfListNodeTypes = (
8491
request: Readonly<ListNodeTypesRequest> = {},

packages_generated/mongodb/src/v1alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export type {
2424
GetSnapshotRequest,
2525
Instance,
2626
InstanceSetting,
27+
InstanceSnapshotSchedule,
2728
InstanceStatus,
2829
ListInstancesRequest,
2930
ListInstancesRequestOrderBy,

packages_generated/mongodb/src/v1alpha1/marshalling.gen.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import type {
2222
EndpointSpecPublicDetails,
2323
Instance,
2424
InstanceSetting,
25+
InstanceSnapshotSchedule,
2526
ListInstancesResponse,
2627
ListNodeTypesResponse,
2728
ListSnapshotsResponse,
@@ -105,6 +106,24 @@ export const unmarshalInstanceSetting = (data: unknown): InstanceSetting => {
105106
} as InstanceSetting
106107
}
107108

109+
export const unmarshalInstanceSnapshotSchedule = (
110+
data: unknown,
111+
): InstanceSnapshotSchedule => {
112+
if (!isJSONObject(data)) {
113+
throw new TypeError(
114+
`Unmarshalling the type 'InstanceSnapshotSchedule' failed as data isn't a dictionary.`,
115+
)
116+
}
117+
118+
return {
119+
enabled: data.enabled,
120+
frequencyHours: data.frequency_hours,
121+
lastRun: unmarshalDate(data.last_run),
122+
nextUpdate: unmarshalDate(data.next_update),
123+
retentionDays: data.retention_days,
124+
} as InstanceSnapshotSchedule
125+
}
126+
108127
export const unmarshalVolume = (data: unknown): Volume => {
109128
if (!isJSONObject(data)) {
110129
throw new TypeError(
@@ -135,6 +154,9 @@ export const unmarshalInstance = (data: unknown): Instance => {
135154
projectId: data.project_id,
136155
region: data.region,
137156
settings: unmarshalArrayOfObject(data.settings, unmarshalInstanceSetting),
157+
snapshotSchedule: data.snapshot_schedule
158+
? unmarshalInstanceSnapshotSchedule(data.snapshot_schedule)
159+
: undefined,
138160
status: data.status,
139161
tags: data.tags,
140162
version: data.version,

packages_generated/mongodb/src/v1alpha1/types.gen.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ export interface InstanceSetting {
120120
value: string
121121
}
122122

123+
export interface InstanceSnapshotSchedule {
124+
frequencyHours: number
125+
retentionDays: number
126+
enabled: boolean
127+
nextUpdate?: Date
128+
lastRun?: Date
129+
}
130+
123131
export interface Volume {
124132
/**
125133
* Type of volume where data is stored.
@@ -297,6 +305,10 @@ export interface Instance {
297305
* Creation date (must follow the ISO 8601 format).
298306
*/
299307
createdAt?: Date
308+
/**
309+
* Snapshot schedule configuration of the Database Instance.
310+
*/
311+
snapshotSchedule?: InstanceSnapshotSchedule
300312
/**
301313
* Region the Database Instance is in.
302314
*/

0 commit comments

Comments
 (0)