Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions packages/clients/src/api/vpc/v2/api.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
marshalCreateVPCRequest,
marshalDeleteSubnetsRequest,
marshalSetAclRequest,
marshalSetSubnetsRequest,
marshalUpdatePrivateNetworkRequest,
marshalUpdateRouteRequest,
marshalUpdateVPCRequest,
Expand All @@ -27,7 +26,6 @@ import {
unmarshalPrivateNetwork,
unmarshalRoute,
unmarshalSetAclResponse,
unmarshalSetSubnetsResponse,
unmarshalVPC,
} from './marshalling.gen'
import type {
Expand Down Expand Up @@ -58,8 +56,6 @@ import type {
Route,
SetAclRequest,
SetAclResponse,
SetSubnetsRequest,
SetSubnetsResponse,
UpdatePrivateNetworkRequest,
UpdateRouteRequest,
UpdateVPCRequest,
Expand Down Expand Up @@ -361,27 +357,6 @@ export class API extends ParentAPI {
listSubnets = (request: Readonly<ListSubnetsRequest> = {}) =>
enrichForPagination('subnets', this.pageOfListSubnets, request)

/**
* Set a Private Network's subnets. Set subnets for an existing Private
* Network. Note that the method is PUT and not PATCH. Any existing subnets
* will be removed in favor of the new specified set of subnets.
*
* @param request - The request {@link SetSubnetsRequest}
* @returns A Promise of SetSubnetsResponse
*/
setSubnets = (request: Readonly<SetSubnetsRequest>) =>
this.client.fetch<SetSubnetsResponse>(
{
body: JSON.stringify(
marshalSetSubnetsRequest(request, this.client.settings),
),
headers: jsonContentHeaders,
method: 'PUT',
path: `/vpc/v2/regions/${validatePathParam('region', request.region ?? this.client.settings.defaultRegion)}/private-networks/${validatePathParam('privateNetworkId', request.privateNetworkId)}/subnets`,
},
unmarshalSetSubnetsResponse,
)

/**
* Add subnets to a Private Network. Add new subnets to an existing Private
* Network.
Expand Down
2 changes: 0 additions & 2 deletions packages/clients/src/api/vpc/v2/index.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ export type {
Route,
SetAclRequest,
SetAclResponse,
SetSubnetsRequest,
SetSubnetsResponse,
Subnet,
UpdatePrivateNetworkRequest,
UpdateRouteRequest,
Expand Down
23 changes: 0 additions & 23 deletions packages/clients/src/api/vpc/v2/marshalling.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import type {
Route,
SetAclRequest,
SetAclResponse,
SetSubnetsRequest,
SetSubnetsResponse,
Subnet,
UpdatePrivateNetworkRequest,
UpdateRouteRequest,
Expand Down Expand Up @@ -237,20 +235,6 @@ export const unmarshalSetAclResponse = (data: unknown): SetAclResponse => {
} as SetAclResponse
}

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

return {
subnets: data.subnets,
} as SetSubnetsResponse
}

export const marshalAddSubnetsRequest = (
request: AddSubnetsRequest,
defaults: DefaultValues,
Expand Down Expand Up @@ -322,13 +306,6 @@ export const marshalSetAclRequest = (
rules: request.rules.map(elt => marshalAclRule(elt, defaults)),
})

export const marshalSetSubnetsRequest = (
request: SetSubnetsRequest,
defaults: DefaultValues,
): Record<string, unknown> => ({
subnets: request.subnets,
})

export const marshalUpdatePrivateNetworkRequest = (
request: UpdatePrivateNetworkRequest,
defaults: DefaultValues,
Expand Down
16 changes: 0 additions & 16 deletions packages/clients/src/api/vpc/v2/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,22 +500,6 @@ export interface SetAclResponse {
defaultPolicy: Action
}

export type SetSubnetsRequest = {
/**
* Region to target. If none is passed will use default region from the
* config.
*/
region?: ScwRegion
/** Private Network ID. */
privateNetworkId: string
/** Private Network subnets CIDR. */
subnets?: string[]
}

export interface SetSubnetsResponse {
subnets: string[]
}

export type UpdatePrivateNetworkRequest = {
/**
* Region to target. If none is passed will use default region from the
Expand Down
Loading