Skip to content

Commit 43e896e

Browse files
feat(interlink): add support for range (#2561)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 44aa2db commit 43e896e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

packages_generated/interlink/src/v1beta1/index.gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export type {
4444
Partner,
4545
PartnerHost,
4646
Pop,
47+
Range,
4748
RoutingPolicy,
4849
SelfHost,
4950
SetRoutingPolicyRequest,

packages_generated/interlink/src/v1beta1/marshalling.gen.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,27 @@ import type {
2424
Partner,
2525
PartnerHost,
2626
Pop,
27+
Range,
2728
RoutingPolicy,
2829
SelfHost,
2930
SetRoutingPolicyRequest,
3031
UpdateLinkRequest,
3132
UpdateRoutingPolicyRequest,
3233
} from './types.gen.js'
3334

35+
const unmarshalRange = (data: unknown): Range => {
36+
if (!isJSONObject(data)) {
37+
throw new TypeError(
38+
`Unmarshalling the type 'Range' failed as data isn't a dictionary.`,
39+
)
40+
}
41+
42+
return {
43+
end: data.end,
44+
start: data.start,
45+
} as Range
46+
}
47+
3448
export const unmarshalDedicatedConnection = (
3549
data: unknown,
3650
): DedicatedConnection => {
@@ -54,6 +68,7 @@ export const unmarshalDedicatedConnection = (
5468
status: data.status,
5569
tags: data.tags,
5670
updatedAt: unmarshalDate(data.updated_at),
71+
vlanRange: data.vlan_range ? unmarshalRange(data.vlan_range) : undefined,
5772
} as DedicatedConnection
5873
}
5974

packages_generated/interlink/src/v1beta1/types.gen.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ export interface BgpConfig {
7575
ipv6: string
7676
}
7777

78+
export interface Range {
79+
start: number
80+
end: number
81+
}
82+
7883
export interface PartnerHost {
7984
/**
8085
* ID of the partner facilitating the link.
@@ -146,6 +151,10 @@ export interface DedicatedConnection {
146151
* Demarcation details required by the data center to set up the supporting Cross Connect. This generally includes the physical space in the facility, the cabinet or rack the connection should land in, the patch panel to go in, the port designation, and the media type.
147152
*/
148153
demarcationInfo?: string
154+
/**
155+
* Range in which to pick vlan for self-hosted links on this dedicated connection. Both start & end are included. Any range defined here must be itself included in the greater allowed range of vlans from 1500 to 3899 (this range is hardware dependent and can change over time, but actual range will be enforced).
156+
*/
157+
vlanRange?: Range
149158
/**
150159
* Region of the dedicated connection.
151160
*/

0 commit comments

Comments
 (0)