Skip to content

Commit 0eff217

Browse files
committed
feat: update generated APIs
1 parent b1e0e4d commit 0eff217

File tree

11 files changed

+163
-10
lines changed

11 files changed

+163
-10
lines changed

packages_generated/audit_trail/src/v1alpha1/validation-rules.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const ListEventsRequest = {
4747
lessThanOrEqual: 1000,
4848
},
4949
productName: {
50-
pattern: /^[a-z]+(-[a-z]+)*$/,
50+
pattern: /^[a-z0-9]+(-[a-z0-9]+)*$/,
5151
},
5252
resourceId: {
5353
maxLength: 100,

packages_generated/cockpit/src/v1/api.gen.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import {
4040
unmarshalListGrafanaProductDashboardsResponse,
4141
unmarshalListGrafanaUsersResponse,
4242
unmarshalListPlansResponse,
43+
unmarshalListProductsResponse,
4344
unmarshalListTokensResponse,
4445
unmarshalPlan,
4546
unmarshalToken,
@@ -73,6 +74,7 @@ import type {
7374
ListGrafanaProductDashboardsResponse,
7475
ListGrafanaUsersResponse,
7576
ListPlansResponse,
77+
ListProductsResponse,
7678
ListTokensResponse,
7779
Plan,
7880
RegionalApiCreateContactPointRequest,
@@ -94,6 +96,7 @@ import type {
9496
RegionalApiListAlertsRequest,
9597
RegionalApiListContactPointsRequest,
9698
RegionalApiListDataSourcesRequest,
99+
RegionalApiListProductsRequest,
97100
RegionalApiListTokensRequest,
98101
RegionalApiTriggerTestAlertRequest,
99102
RegionalApiUpdateContactPointRequest,
@@ -627,6 +630,34 @@ You can filter tokens by Project ID and token scopes.
627630
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/tokens/${validatePathParam('tokenId', request.tokenId)}`,
628631
})
629632

633+
protected pageOfListProducts = (
634+
request: Readonly<RegionalApiListProductsRequest> = {},
635+
) =>
636+
this.client.fetch<ListProductsResponse>(
637+
{
638+
method: 'GET',
639+
path: `/cockpit/v1/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/products`,
640+
urlParams: urlParams(
641+
['order_by', request.orderBy],
642+
['page', request.page],
643+
[
644+
'page_size',
645+
request.pageSize ?? this.client.settings.defaultPageSize,
646+
],
647+
),
648+
},
649+
unmarshalListProductsResponse,
650+
)
651+
652+
/**
653+
* List all Scaleway products that send metrics and/or logs to Cockpit.. List all Scaleway products that send metrics and/or logs to Cockpit.
654+
*
655+
* @param request - The request {@link RegionalApiListProductsRequest}
656+
* @returns A Promise of ListProductsResponse
657+
*/
658+
listProducts = (request: Readonly<RegionalApiListProductsRequest> = {}) =>
659+
enrichForPagination('productsList', this.pageOfListProducts, request)
660+
630661
/**
631662
* Get the Alert manager. Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
632663
The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.

packages_generated/cockpit/src/v1/index.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,14 @@ export type {
4444
ListGrafanaUsersResponse,
4545
ListPlansRequestOrderBy,
4646
ListPlansResponse,
47+
ListProductsRequestOrderBy,
48+
ListProductsResponse,
4749
ListTokensRequestOrderBy,
4850
ListTokensResponse,
4951
Plan,
5052
PlanName,
5153
PreconfiguredAlertData,
54+
Product,
5255
RegionalApiCreateContactPointRequest,
5356
RegionalApiCreateDataSourceRequest,
5457
RegionalApiCreateTokenRequest,
@@ -68,6 +71,7 @@ export type {
6871
RegionalApiListAlertsRequest,
6972
RegionalApiListContactPointsRequest,
7073
RegionalApiListDataSourcesRequest,
74+
RegionalApiListProductsRequest,
7175
RegionalApiListTokensRequest,
7276
RegionalApiTriggerTestAlertRequest,
7377
RegionalApiUpdateContactPointRequest,

packages_generated/cockpit/src/v1/marshalling.gen.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ import type {
3131
ListGrafanaProductDashboardsResponse,
3232
ListGrafanaUsersResponse,
3333
ListPlansResponse,
34+
ListProductsResponse,
3435
ListTokensResponse,
3536
Plan,
3637
PreconfiguredAlertData,
38+
Product,
3739
RegionalApiCreateContactPointRequest,
3840
RegionalApiCreateDataSourceRequest,
3941
RegionalApiCreateTokenRequest,
@@ -444,6 +446,36 @@ export const unmarshalListPlansResponse = (
444446
} as ListPlansResponse
445447
}
446448

449+
const unmarshalProduct = (data: unknown): Product => {
450+
if (!isJSONObject(data)) {
451+
throw new TypeError(
452+
`Unmarshalling the type 'Product' failed as data isn't a dictionary.`,
453+
)
454+
}
455+
456+
return {
457+
displayName: data.display_name,
458+
familyName: data.family_name,
459+
name: data.name,
460+
resourceTypes: data.resource_types,
461+
} as Product
462+
}
463+
464+
export const unmarshalListProductsResponse = (
465+
data: unknown,
466+
): ListProductsResponse => {
467+
if (!isJSONObject(data)) {
468+
throw new TypeError(
469+
`Unmarshalling the type 'ListProductsResponse' failed as data isn't a dictionary.`,
470+
)
471+
}
472+
473+
return {
474+
productsList: unmarshalArrayOfObject(data.products_list, unmarshalProduct),
475+
totalCount: data.total_count,
476+
} as ListProductsResponse
477+
}
478+
447479
export const unmarshalListTokensResponse = (
448480
data: unknown,
449481
): ListTokensResponse => {

packages_generated/cockpit/src/v1/types.gen.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export type ListGrafanaUsersRequestOrderBy = 'login_asc' | 'login_desc'
3333

3434
export type ListPlansRequestOrderBy = 'name_asc' | 'name_desc'
3535

36+
export type ListProductsRequestOrderBy =
37+
| 'created_at_asc'
38+
| 'created_at_desc'
39+
| 'display_name_asc'
40+
| 'display_name_desc'
41+
| 'family_name_asc'
42+
| 'family_name_desc'
43+
3644
export type ListTokensRequestOrderBy =
3745
| 'created_at_asc'
3846
| 'created_at_desc'
@@ -308,6 +316,13 @@ export interface Plan {
308316
monthlyPrice: number
309317
}
310318

319+
export interface Product {
320+
name: string
321+
displayName: string
322+
familyName: string
323+
resourceTypes: string[]
324+
}
325+
311326
/**
312327
* Token.
313328
*/
@@ -732,6 +747,11 @@ export interface ListPlansResponse {
732747
plans: Plan[]
733748
}
734749

750+
export interface ListProductsResponse {
751+
productsList: Product[]
752+
totalCount: number
753+
}
754+
735755
/**
736756
* Response returned when listing tokens.
737757
*/
@@ -1082,6 +1102,28 @@ export type RegionalApiListDataSourcesRequest = {
10821102
types?: DataSourceType[]
10831103
}
10841104

1105+
/**
1106+
* List all Scaleway products that send metrics and/or logs to Cockpit.
1107+
*/
1108+
export type RegionalApiListProductsRequest = {
1109+
/**
1110+
* Region to target. If none is passed will use default region from the config.
1111+
*/
1112+
region?: ScwRegion
1113+
/**
1114+
* Page number to return from the paginated results.
1115+
*/
1116+
page?: number
1117+
/**
1118+
* Number of products to return per page.
1119+
*/
1120+
pageSize?: number
1121+
/**
1122+
* Sort order for products in the response.
1123+
*/
1124+
orderBy?: ListProductsRequestOrderBy
1125+
}
1126+
10851127
/**
10861128
* List tokens.
10871129
*/

packages_generated/cockpit/src/v1/validation-rules.gen.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,17 @@ export const RegionalApiListDataSourcesRequest = {
4242
},
4343
}
4444

45+
export const RegionalApiListProductsRequest = {
46+
page: {
47+
greaterThanOrEqual: 1,
48+
lessThanOrEqual: 10000,
49+
},
50+
pageSize: {
51+
greaterThanOrEqual: 1,
52+
lessThanOrEqual: 100,
53+
},
54+
}
55+
4556
export const RegionalApiListTokensRequest = {
4657
page: {
4758
greaterThanOrEqual: 1,

packages_generated/product_catalog/src/v2alpha1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export type {
2626
PublicCatalogProductPropertiesHardwareRAM,
2727
PublicCatalogProductPropertiesHardwareStorage,
2828
PublicCatalogProductPropertiesInstance,
29+
PublicCatalogProductPropertiesManagedInference,
2930
PublicCatalogProductPropertiesObjectStorage,
3031
PublicCatalogProductStatus,
3132
PublicCatalogProductUnitOfMeasure,

packages_generated/product_catalog/src/v2alpha1/marshalling.gen.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type {
2626
PublicCatalogProductPropertiesHardwareRAM,
2727
PublicCatalogProductPropertiesHardwareStorage,
2828
PublicCatalogProductPropertiesInstance,
29+
PublicCatalogProductPropertiesManagedInference,
2930
PublicCatalogProductPropertiesObjectStorage,
3031
PublicCatalogProductUnitOfMeasure,
3132
} from './types.gen.js'
@@ -255,6 +256,20 @@ const unmarshalPublicCatalogProductPropertiesInstance = (
255256
} as PublicCatalogProductPropertiesInstance
256257
}
257258

259+
const unmarshalPublicCatalogProductPropertiesManagedInference = (
260+
data: unknown,
261+
): PublicCatalogProductPropertiesManagedInference => {
262+
if (!isJSONObject(data)) {
263+
throw new TypeError(
264+
`Unmarshalling the type 'PublicCatalogProductPropertiesManagedInference' failed as data isn't a dictionary.`,
265+
)
266+
}
267+
268+
return {
269+
instanceGpuName: data.instance_gpu_name,
270+
} as PublicCatalogProductPropertiesManagedInference
271+
}
272+
258273
const unmarshalPublicCatalogProductPropertiesObjectStorage = (
259274
data: unknown,
260275
): PublicCatalogProductPropertiesObjectStorage => {
@@ -343,6 +358,11 @@ const unmarshalPublicCatalogProductProperties = (
343358
instance: data.instance
344359
? unmarshalPublicCatalogProductPropertiesInstance(data.instance)
345360
: undefined,
361+
managedInference: data.managed_inference
362+
? unmarshalPublicCatalogProductPropertiesManagedInference(
363+
data.managed_inference,
364+
)
365+
: undefined,
346366
objectStorage: data.object_storage
347367
? unmarshalPublicCatalogProductPropertiesObjectStorage(
348368
data.object_storage,

packages_generated/product_catalog/src/v2alpha1/types.gen.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export type ListPublicCatalogProductsRequestProductType =
1414
| 'dedibox'
1515
| 'block_storage'
1616
| 'object_storage'
17+
| 'managed_inference'
1718

1819
export type ListPublicCatalogProductsRequestStatus =
1920
| 'unknown_status'
@@ -279,6 +280,13 @@ export interface PublicCatalogProductPropertiesInstance {
279280
recommendedReplacementOfferIds: string[]
280281
}
281282

283+
export interface PublicCatalogProductPropertiesManagedInference {
284+
/**
285+
* The name of the associated instance GPU to this node type.
286+
*/
287+
instanceGpuName: string
288+
}
289+
282290
export interface PublicCatalogProductPropertiesObjectStorage {}
283291

284292
export interface PublicCatalogProductEnvironmentalImpactEstimation {
@@ -328,39 +336,45 @@ export interface PublicCatalogProductProperties {
328336
/**
329337
* The properties of Dedibox products.
330338
*
331-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
339+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
332340
*/
333341
dedibox?: PublicCatalogProductPropertiesDedibox
334342
/**
335343
* The properties of Elastic Metal products.
336344
*
337-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
345+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
338346
*/
339347
elasticMetal?: PublicCatalogProductPropertiesElasticMetal
340348
/**
341349
* The properties of Apple Silicon products.
342350
*
343-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
351+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
344352
*/
345353
appleSilicon?: PublicCatalogProductPropertiesAppleSilicon
346354
/**
347355
* The properties of Instance products.
348356
*
349-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
357+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
350358
*/
351359
instance?: PublicCatalogProductPropertiesInstance
352360
/**
353361
* The properties of Block Storage products.
354362
*
355-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
363+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
356364
*/
357365
blockStorage?: PublicCatalogProductPropertiesBlockStorage
358366
/**
359367
* The properties of Object Storage products.
360368
*
361-
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage' could be set.
369+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
362370
*/
363371
objectStorage?: PublicCatalogProductPropertiesObjectStorage
372+
/**
373+
* The properties of Managed Inference products.
374+
*
375+
* One-of ('properties'): at most one of 'dedibox', 'elasticMetal', 'appleSilicon', 'instance', 'blockStorage', 'objectStorage', 'managedInference' could be set.
376+
*/
377+
managedInference?: PublicCatalogProductPropertiesManagedInference
364378
}
365379

366380
export interface PublicCatalogProductUnitOfMeasure {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class API extends ParentAPI {
109109
})
110110

111111
/**
112-
* Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain. The subject of the email must contain at least 6 characters.
112+
* Send an email. You must specify the `region`, the sender and the recipient's information and the `project_id` to send an email from a checked domain.
113113
*
114114
* @param request - The request {@link CreateEmailRequest}
115115
* @returns A Promise of CreateEmailResponse

0 commit comments

Comments
 (0)