Skip to content

Commit 80ff76e

Browse files
committed
feat: update generated APIs
1 parent a138582 commit 80ff76e

File tree

6 files changed

+110
-0
lines changed

6 files changed

+110
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* This file is automatically generated
3+
* PLEASE DO NOT EDIT HERE
4+
*/
5+
6+
export * as Autoscalingv1alpha1 from './v1alpha1/index.gen'
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 './marshalling.gen'
5+
export type {
6+
Capacity,
7+
CreateInstanceGroupRequest,
8+
CreateInstancePolicyRequest,
9+
CreateInstanceTemplateRequest,
10+
DeleteInstanceGroupRequest,
11+
DeleteInstancePolicyRequest,
12+
DeleteInstanceTemplateRequest,
13+
GetInstanceGroupRequest,
14+
GetInstancePolicyRequest,
15+
GetInstanceTemplateRequest,
16+
InstanceGroup,
17+
InstanceGroupEvent,
18+
InstanceGroupEventLevel,
19+
InstanceGroupEventSource,
20+
InstancePolicy,
21+
InstancePolicyAction,
22+
InstancePolicyType,
23+
InstanceTemplate,
24+
InstanceTemplateStatus,
25+
ListInstanceGroupEventsRequest,
26+
ListInstanceGroupEventsRequestOrderBy,
27+
ListInstanceGroupEventsResponse,
28+
ListInstanceGroupsRequest,
29+
ListInstanceGroupsRequestOrderBy,
30+
ListInstanceGroupsResponse,
31+
ListInstancePoliciesRequest,
32+
ListInstancePoliciesRequestOrderBy,
33+
ListInstancePoliciesResponse,
34+
ListInstanceTemplatesRequest,
35+
ListInstanceTemplatesRequestOrderBy,
36+
ListInstanceTemplatesResponse,
37+
Loadbalancer,
38+
Metric,
39+
MetricAggregate,
40+
MetricManagedMetric,
41+
MetricOperator,
42+
UpdateInstanceGroupRequest,
43+
UpdateInstanceGroupRequestCapacity,
44+
UpdateInstanceGroupRequestLoadbalancer,
45+
UpdateInstancePolicyRequest,
46+
UpdateInstancePolicyRequestMetric,
47+
UpdateInstancePolicyRequestMetricAggregate,
48+
UpdateInstancePolicyRequestMetricManagedMetric,
49+
UpdateInstancePolicyRequestMetricOperator,
50+
UpdateInstanceTemplateRequest,
51+
VolumeInstanceTemplate,
52+
VolumeInstanceTemplateFromEmpty,
53+
VolumeInstanceTemplateFromSnapshot,
54+
VolumeInstanceTemplateVolumeType,
55+
} from './types.gen'
56+
export * as ValidationRules from './validation-rules.gen'

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
unmarshalEncryptResponse,
2020
unmarshalKey,
2121
unmarshalListKeysResponse,
22+
unmarshalPublicKey,
2223
} from './marshalling.gen'
2324
import type {
2425
CreateKeyRequest,
@@ -33,11 +34,13 @@ import type {
3334
EncryptResponse,
3435
GenerateDataKeyRequest,
3536
GetKeyRequest,
37+
GetPublicKeyRequest,
3638
ImportKeyMaterialRequest,
3739
Key,
3840
ListKeysRequest,
3941
ListKeysResponse,
4042
ProtectKeyRequest,
43+
PublicKey,
4144
RotateKeyRequest,
4245
UnprotectKeyRequest,
4346
UpdateKeyRequest,
@@ -94,6 +97,21 @@ export class API extends ParentAPI {
9497
unmarshalKey,
9598
)
9699

100+
/**
101+
* Get the public key in PEM format.. Retrieves the public portion of an asymmetric cryptographic key in PEM format.
102+
*
103+
* @param request - The request {@link GetPublicKeyRequest}
104+
* @returns A Promise of PublicKey
105+
*/
106+
getPublicKey = (request: Readonly<GetPublicKeyRequest>) =>
107+
this.client.fetch<PublicKey>(
108+
{
109+
method: 'GET',
110+
path: `/key-manager/v1alpha1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/keys/${validatePathParam('keyId', request.keyId)}/public-key`,
111+
},
112+
unmarshalPublicKey,
113+
)
114+
97115
/**
98116
* Update a key. Modify a key's metadata including name, description and tags, specified by the `key_id` and `region` parameters.
99117
*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export type {
1616
EncryptResponse,
1717
GenerateDataKeyRequest,
1818
GetKeyRequest,
19+
GetPublicKeyRequest,
1920
ImportKeyMaterialRequest,
2021
Key,
2122
KeyAlgorithmSymmetricEncryption,
@@ -27,6 +28,7 @@ export type {
2728
ListKeysRequestOrderBy,
2829
ListKeysResponse,
2930
ProtectKeyRequest,
31+
PublicKey,
3032
RotateKeyRequest,
3133
UnprotectKeyRequest,
3234
UpdateKeyRequest,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import type {
2020
KeyRotationPolicy,
2121
KeyUsage,
2222
ListKeysResponse,
23+
PublicKey,
2324
UpdateKeyRequest,
2425
} from './types.gen'
2526

@@ -135,6 +136,18 @@ export const unmarshalListKeysResponse = (data: unknown): ListKeysResponse => {
135136
} as ListKeysResponse
136137
}
137138

139+
export const unmarshalPublicKey = (data: unknown): PublicKey => {
140+
if (!isJSONObject(data)) {
141+
throw new TypeError(
142+
`Unmarshalling the type 'PublicKey' failed as data isn't a dictionary.`,
143+
)
144+
}
145+
146+
return {
147+
pem: data.pem,
148+
} as PublicKey
149+
}
150+
138151
const marshalKeyRotationPolicy = (
139152
request: KeyRotationPolicy,
140153
defaults: DefaultValues,

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,17 @@ export type GetKeyRequest = {
314314
keyId: string
315315
}
316316

317+
export type GetPublicKeyRequest = {
318+
/**
319+
* Region to target. If none is passed will use default region from the config.
320+
*/
321+
region?: ScwRegion
322+
/**
323+
* ID of the key.
324+
*/
325+
keyId: string
326+
}
327+
317328
export type ImportKeyMaterialRequest = {
318329
/**
319330
* Region to target. If none is passed will use default region from the config.
@@ -381,6 +392,10 @@ export type ProtectKeyRequest = {
381392
keyId: string
382393
}
383394

395+
export interface PublicKey {
396+
pem: string
397+
}
398+
384399
export type RotateKeyRequest = {
385400
/**
386401
* Region to target. If none is passed will use default region from the config.

0 commit comments

Comments
 (0)