Skip to content

Commit dc256b5

Browse files
committed
feat: update generated APIs
1 parent b7654e6 commit dc256b5

File tree

22 files changed

+4120
-8
lines changed

22 files changed

+4120
-8
lines changed

packages/clients/src/api/audit_trail/v1alpha1/api.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ export class API extends ParentAPI {
7272
{
7373
method: 'GET',
7474
path: `/audit-trail/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`,
75+
urlParams: urlParams([
76+
'organization_id',
77+
request.organizationId ?? this.client.settings.defaultOrganizationId,
78+
]),
7579
},
7680
unmarshalListProductsResponse,
7781
)

packages/clients/src/api/audit_trail/v1alpha1/marshalling.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ export const unmarshalEvent = (data: unknown): Event => {
179179
requestBody: data.request_body,
180180
requestId: data.request_id,
181181
resource: data.resource ? unmarshalResource(data.resource) : undefined,
182+
resources: unmarshalArrayOfObject(data.resources, unmarshalResource),
182183
serviceName: data.service_name,
183184
sourceIp: data.source_ip,
184185
statusCode: data.status_code,

packages/clients/src/api/audit_trail/v1alpha1/types.gen.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export type ResourceType =
1313
| 'kube_node'
1414
| 'kube_acl'
1515
| 'keym_key'
16-
| 'iamx_user'
17-
| 'iamx_application'
18-
| 'iamx_group'
19-
| 'iamx_policy'
20-
| 'iamx_api_key'
21-
| 'iamx_ssh_key'
16+
| 'iam_user'
17+
| 'iam_application'
18+
| 'iam_group'
19+
| 'iam_policy'
20+
| 'iam_api_key'
21+
| 'iam_ssh_key'
2222

2323
export interface KeyManagerKeyInfo {}
2424

@@ -127,8 +127,10 @@ export interface Event {
127127
serviceName: string
128128
/** API method called to trigger the event. */
129129
methodName: string
130-
/** Resource attached to the event. */
130+
/** @deprecated Resource attached to the event. */
131131
resource?: Resource
132+
/** Resources attached to the event. */
133+
resources: Resource[]
132134
/** Unique identifier of the request at the origin of the event. */
133135
requestId: string
134136
/** Request at the origin of the event. */
@@ -199,6 +201,8 @@ export type ListProductsRequest = {
199201
* config.
200202
*/
201203
region?: ScwRegion
204+
/** ID of the Organization containing the Audit Trail events. */
205+
organizationId?: string
202206
}
203207

204208
export interface ListProductsResponse {

packages/clients/src/api/baremetal/v1/api.gen.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ import type {
7070
ListServersResponse,
7171
ListSettingsRequest,
7272
ListSettingsResponse,
73+
MigrateServerToMonthlyOfferRequest,
7374
OS,
7475
Offer,
7576
Option,
@@ -517,6 +518,23 @@ export class API extends ParentAPI {
517518
unmarshalServer,
518519
)
519520

521+
/**
522+
* Migrate server offer. Migrate server with hourly offer to monthly offer.
523+
*
524+
* @param request - The request {@link MigrateServerToMonthlyOfferRequest}
525+
* @returns A Promise of Server
526+
*/
527+
migrateServerToMonthlyOffer = (
528+
request: Readonly<MigrateServerToMonthlyOfferRequest>,
529+
) =>
530+
this.client.fetch<Server>(
531+
{
532+
method: 'POST',
533+
path: `/baremetal/v1/zones/${validatePathParam('zone', request.zone ?? this.client.settings.defaultZone)}/servers/${validatePathParam('serverId', request.serverId)}/migrate-offer-monthly`,
534+
},
535+
unmarshalServer,
536+
)
537+
520538
protected pageOfListOffers = (request: Readonly<ListOffersRequest> = {}) =>
521539
this.client.fetch<ListOffersResponse>(
522540
{

packages/clients/src/api/baremetal/v1/content.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ export const SERVER_TRANSIENT_STATUSES: ServerStatus[] = [
2424
'deleting',
2525
'ordered',
2626
'resetting',
27+
'migrating',
2728
]

packages/clients/src/api/baremetal/v1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type {
4444
ListSettingsRequestOrderBy,
4545
ListSettingsResponse,
4646
Memory,
47+
MigrateServerToMonthlyOfferRequest,
4748
OS,
4849
OSOSField,
4950
Offer,

packages/clients/src/api/baremetal/v1/marshalling.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ export const unmarshalOffer = (data: unknown): Offer => {
421421
incompatibleOsIds: data.incompatible_os_ids,
422422
maxBandwidth: data.max_bandwidth,
423423
memories: unmarshalArrayOfObject(data.memories, unmarshalMemory),
424+
monthlyOfferId: data.monthly_offer_id,
424425
name: data.name,
425426
operationPath: data.operation_path,
426427
options: unmarshalArrayOfObject(data.options, unmarshalOfferOptionOffer),

packages/clients/src/api/baremetal/v1/types.gen.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export type ServerStatus =
104104
| 'out_of_stock'
105105
| 'ordered'
106106
| 'resetting'
107+
| 'migrating'
107108

108109
export type SettingType = 'unknown' | 'smtp'
109110

@@ -479,6 +480,8 @@ export interface Offer {
479480
tags: string[]
480481
/** GPU specifications of the offer. */
481482
gpus: GPU[]
483+
/** Exist only for hourly offers, to migrate to the monthly offer. */
484+
monthlyOfferId?: string
482485
}
483486

484487
export interface Option {
@@ -900,6 +903,13 @@ export interface ListSettingsResponse {
900903
settings: Setting[]
901904
}
902905

906+
export type MigrateServerToMonthlyOfferRequest = {
907+
/** Zone to target. If none is passed will use default zone from the config. */
908+
zone?: ScwZone
909+
/** ID of the server. */
910+
serverId: string
911+
}
912+
903913
export type PrivateNetworkApiAddServerPrivateNetworkRequest = {
904914
/** Zone to target. If none is passed will use default zone from the config. */
905915
zone?: ScwZone

packages/clients/src/api/block/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
* EDIT HERE
44
*/
55

6+
export * as v1 from './v1/index.gen'
67
export * as v1alpha1 from './v1alpha1/index.gen'
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// This file was automatically generated. DO NOT EDIT.
2+
// If you have any remark or suggestion do not hesitate to open an issue.
3+
export { API } from './api.gen'
4+
export * from './content.gen'
5+
export type {
6+
CreateSnapshotRequest,
7+
CreateVolumeRequest,
8+
CreateVolumeRequestFromEmpty,
9+
CreateVolumeRequestFromSnapshot,
10+
DeleteSnapshotRequest,
11+
DeleteVolumeRequest,
12+
ExportSnapshotToObjectStorageRequest,
13+
GetSnapshotRequest,
14+
GetVolumeRequest,
15+
ImportSnapshotFromObjectStorageRequest,
16+
ListSnapshotsRequest,
17+
ListSnapshotsRequestOrderBy,
18+
ListSnapshotsResponse,
19+
ListVolumeTypesRequest,
20+
ListVolumeTypesResponse,
21+
ListVolumesRequest,
22+
ListVolumesRequestOrderBy,
23+
ListVolumesResponse,
24+
Reference,
25+
ReferenceStatus,
26+
ReferenceType,
27+
Snapshot,
28+
SnapshotParentVolume,
29+
SnapshotStatus,
30+
StorageClass,
31+
UpdateSnapshotRequest,
32+
UpdateVolumeRequest,
33+
Volume,
34+
VolumeSpecifications,
35+
VolumeStatus,
36+
VolumeType,
37+
} from './types.gen'
38+
export * as ValidationRules from './validation-rules.gen'

0 commit comments

Comments
 (0)