Skip to content

Commit

Permalink
Merge branch 'main' into v1.6045.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Codelax authored Jan 30, 2025
2 parents 8f1db0c + c638994 commit 7b88aac
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 196 deletions.
19 changes: 19 additions & 0 deletions packages/clients/src/api/iam/v1alpha1/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import type {
PermissionSet,
Policy,
Quotum,
QuotumLimit,
RemoveGroupMemberRequest,
Rule,
RuleSpecs,
Expand Down Expand Up @@ -200,6 +201,22 @@ export const unmarshalPolicy = (data: unknown): Policy => {
} as Policy
}

const unmarshalQuotumLimit = (data: unknown): QuotumLimit => {
if (!isJSONObject(data)) {
throw new TypeError(
`Unmarshalling the type 'QuotumLimit' failed as data isn't a dictionary.`,
)
}

return {
global: data.global,
limit: data.limit,
region: data.region,
unlimited: data.unlimited,
zone: data.zone,
} as QuotumLimit
}

export const unmarshalQuotum = (data: unknown): Quotum => {
if (!isJSONObject(data)) {
throw new TypeError(
Expand All @@ -210,6 +227,8 @@ export const unmarshalQuotum = (data: unknown): Quotum => {
return {
description: data.description,
limit: data.limit,
limits: unmarshalArrayOfObject(data.limits, unmarshalQuotumLimit),
localityType: data.locality_type,
name: data.name,
prettyName: data.pretty_name,
unit: data.unit,
Expand Down
54 changes: 50 additions & 4 deletions packages/clients/src/api/iam/v1alpha1/types.gen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import type { Region as ScwRegion, Zone as ScwZone } from '../../../bridge'

export type BearerType = 'unknown_bearer_type' | 'user' | 'application'

Expand Down Expand Up @@ -76,6 +77,8 @@ export type ListUsersRequestOrderBy =
| 'username_asc'
| 'username_desc'

export type LocalityType = 'global' | 'region' | 'zone'

export type LogAction = 'unknown_action' | 'created' | 'updated' | 'deleted'

export type LogResourceType =
Expand All @@ -96,6 +99,42 @@ export type UserStatus = 'unknown_status' | 'invitation_pending' | 'activated'

export type UserType = 'unknown_type' | 'guest' | 'owner' | 'member'

export interface QuotumLimit {
/**
* Whether or not the limit is applied globally.
*
* One-of ('locality'): at most one of 'global', 'region', 'zone' could be
* set.
*/
global?: boolean
/**
* The region on which the limit is applied.
*
* One-of ('locality'): at most one of 'global', 'region', 'zone' could be
* set.
*/
region?: ScwRegion
/**
* The zone on which the limit is applied.
*
* One-of ('locality'): at most one of 'global', 'region', 'zone' could be
* set.
*/
zone?: ScwZone
/**
* Maximum locality limit.
*
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
*/
limit?: number
/**
* Whether or not the quota per locality is unlimited.
*
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
*/
unlimited?: boolean
}

export interface JWT {
/** JWT ID. */
jti: string
Expand Down Expand Up @@ -345,15 +384,15 @@ export interface Quotum {
/** Name of the quota. */
name: string
/**
* Maximum limit of the quota.
* @deprecated Maximum limit of the quota.
*
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
*/
limit?: number
/**
* Defines whether or not the quota is unlimited.
* @deprecated Defines whether or not the quota is unlimited.
*
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
* One-of ('value'): at most one of 'limit', 'unlimited' could be set.
*/
unlimited?: boolean
/** A human-readable name for the quota. */
Expand All @@ -362,6 +401,13 @@ export interface Quotum {
unit: string
/** Details about the quota. */
description: string
/**
* Whether this quotum is applied on at the zone level, region level, or
* globally.
*/
localityType: LocalityType
/** Limits per locality. */
limits: QuotumLimit[]
}

export interface Rule {
Expand Down
8 changes: 6 additions & 2 deletions packages/clients/src/api/interlink/v1beta1/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
urlParams,
validatePathParam,
} from '../../../bridge'
import type { Region } from '../../../bridge'
import type { Region as ScwRegion } from '../../../bridge'
import {
marshalAttachRoutingPolicyRequest,
marshalAttachVpcRequest,
Expand Down Expand Up @@ -66,7 +66,11 @@ const jsonContentHeaders = {
*/
export class API extends ParentAPI {
/** Lists the available regions of the API. */
public static readonly LOCALITIES: Region[] = ['fr-par', 'nl-ams', 'pl-waw']
public static readonly LOCALITIES: ScwRegion[] = [
'fr-par',
'nl-ams',
'pl-waw',
]

protected pageOfListPartners = (
request: Readonly<ListPartnersRequest> = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const unmarshalLink = (data: unknown): Link => {
bgpV4Status: data.bgp_v4_status,
bgpV6Status: data.bgp_v6_status,
createdAt: unmarshalDate(data.created_at),
disapprovedReason: data.disapproved_reason,
enableRoutePropagation: data.enable_route_propagation,
id: data.id,
name: data.name,
Expand Down
53 changes: 29 additions & 24 deletions packages/clients/src/api/interlink/v1beta1/types.gen.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file was automatically generated. DO NOT EDIT.
// If you have any remark or suggestion do not hesitate to open an issue.
import type { Region } from '../../../bridge'
import type { Region as ScwRegion } from '../../../bridge'

export type BgpStatus = 'unknown_bgp_status' | 'up' | 'down'

Expand Down Expand Up @@ -75,8 +75,13 @@ export interface Link {
updatedAt?: Date
/** Used to identify a link from a user or partner's point of view. */
pairingKey: string
/**
* Reason given by partner to explain why they did not approve the request for
* a hosted link.
*/
disapprovedReason?: string
/** Region of the link. */
region: Region
region: ScwRegion
}

export interface Partner {
Expand Down Expand Up @@ -118,7 +123,7 @@ export interface Pop {
*/
availableLinkBandwidthsMbps: number[]
/** Region of the PoP. */
region: Region
region: ScwRegion
}

export interface RoutingPolicy {
Expand All @@ -144,15 +149,15 @@ export interface RoutingPolicy {
/** Last modification date of the routing policy. */
updatedAt?: Date
/** Region of the routing policy. */
region: Region
region: ScwRegion
}

export type AttachRoutingPolicyRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to attach a routing policy to. */
linkId: string
/** ID of the routing policy to be attached. */
Expand All @@ -164,7 +169,7 @@ export type AttachVpcRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to attach VPC to. */
linkId: string
/** ID of the VPC to attach. */
Expand All @@ -176,7 +181,7 @@ export type CreateLinkRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the Project to create the link in. */
projectId?: string
/** Name of the link. */
Expand Down Expand Up @@ -230,7 +235,7 @@ export type CreateRoutingPolicyRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the Project to create the routing policy in. */
projectId?: string
/** Name of the routing policy. */
Expand All @@ -251,7 +256,7 @@ export type DeleteLinkRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to delete. */
linkId: string
}
Expand All @@ -261,7 +266,7 @@ export type DeleteRoutingPolicyRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the routing policy to delete. */
routingPolicyId: string
}
Expand All @@ -271,7 +276,7 @@ export type DetachRoutingPolicyRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to detach a routing policy from. */
linkId: string
}
Expand All @@ -281,7 +286,7 @@ export type DetachVpcRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to detach the VPC from. */
linkId: string
}
Expand All @@ -291,7 +296,7 @@ export type DisableRoutePropagationRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link on which to disable route propagation. */
linkId: string
}
Expand All @@ -301,7 +306,7 @@ export type EnableRoutePropagationRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link on which to enable route propagation. */
linkId: string
}
Expand All @@ -311,7 +316,7 @@ export type GetLinkRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to get. */
linkId: string
}
Expand All @@ -321,7 +326,7 @@ export type GetPartnerRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of partner to get. */
partnerId: string
}
Expand All @@ -331,7 +336,7 @@ export type GetPopRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of PoP to get. */
popId: string
}
Expand All @@ -341,7 +346,7 @@ export type GetRoutingPolicyRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the routing policy to get. */
routingPolicyId: string
}
Expand All @@ -351,7 +356,7 @@ export type ListLinksRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** Order in which to return results. */
orderBy?: ListLinksRequestOrderBy
/** Page number to return. */
Expand Down Expand Up @@ -398,7 +403,7 @@ export type ListPartnersRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** Order in which to return results. */
orderBy?: ListPartnersRequestOrderBy
/** Page number to return. */
Expand All @@ -421,7 +426,7 @@ export type ListPopsRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** Order in which to return results. */
orderBy?: ListPopsRequestOrderBy
/** Page number to return. */
Expand Down Expand Up @@ -453,7 +458,7 @@ export type ListRoutingPoliciesRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** Order in which to return results. */
orderBy?: ListRoutingPoliciesRequestOrderBy
/** Page number to return. */
Expand All @@ -480,7 +485,7 @@ export type UpdateLinkRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the link to update. */
linkId: string
/** Name of the link. */
Expand All @@ -494,7 +499,7 @@ export type UpdateRoutingPolicyRequest = {
* Region to target. If none is passed will use default region from the
* config.
*/
region?: Region
region?: ScwRegion
/** ID of the routing policy to update. */
routingPolicyId: string
/** Name of the routing policy. */
Expand Down
Loading

0 comments on commit 7b88aac

Please sign in to comment.