Skip to content

Commit 71a688c

Browse files
committed
feat(dedibox): provide ListIPv6Blocks endpoint
1 parent b9ec922 commit 71a688c

File tree

6 files changed

+109
-61
lines changed

6 files changed

+109
-61
lines changed

packages_generated/dedibox/src/index.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
* PLEASE DO NOT EDIT HERE
44
*/
55

6-
export * as Dediboxv1 from './v1/index.gen'
6+
export * as Dediboxv1 from './v1/index.gen.js'

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
RPN_V2_GROUP_TRANSIENT_STATUSES as RPN_V2_GROUP_TRANSIENT_STATUSES_DEDIBOX,
1717
SERVER_INSTALL_TRANSIENT_STATUSES as SERVER_INSTALL_TRANSIENT_STATUSES_DEDIBOX,
1818
SERVER_TRANSIENT_STATUSES as SERVER_TRANSIENT_STATUSES_DEDIBOX,
19-
} from './content.gen'
19+
} from './content.gen.js'
2020
import {
2121
marshalAttachFailoverIPsRequest,
2222
marshalAttachFailoverIPToMacAddressRequest,
@@ -65,6 +65,7 @@ import {
6565
unmarshalListFailoverIPsResponse,
6666
unmarshalListInvoicesResponse,
6767
unmarshalListIPv6BlockSubnetsAvailableResponse,
68+
unmarshalListIPv6BlocksResponse,
6869
unmarshalListIpsResponse,
6970
unmarshalListOffersResponse,
7071
unmarshalListOSResponse,
@@ -98,7 +99,7 @@ import {
9899
unmarshalServerInstall,
99100
unmarshalService,
100101
unmarshalSubscribeStorageOptionsResponse,
101-
} from './marshalling.gen'
102+
} from './marshalling.gen.js'
102103
import type {
103104
AttachFailoverIPsRequest,
104105
AttachFailoverIPToMacAddressRequest,
@@ -148,11 +149,13 @@ import type {
148149
IPv6BlockApiGetIPv6BlockQuotasRequest,
149150
IPv6BlockApiGetIPv6BlockRequest,
150151
IPv6BlockApiListIPv6BlockSubnetsAvailableRequest,
152+
IPv6BlockApiListIPv6BlocksRequest,
151153
IPv6BlockApiUpdateIPv6BlockRequest,
152154
ListFailoverIPsRequest,
153155
ListFailoverIPsResponse,
154156
ListInvoicesResponse,
155157
ListIPv6BlockSubnetsAvailableResponse,
158+
ListIPv6BlocksResponse,
156159
ListIpsResponse,
157160
ListOffersRequest,
158161
ListOffersResponse,
@@ -245,7 +248,7 @@ import type {
245248
UpdateServerBackupRequest,
246249
UpdateServerRequest,
247250
UpdateServerTagsRequest,
248-
} from './types.gen'
251+
} from './types.gen.js'
249252

250253
const jsonContentHeaders = {
251254
'Content-Type': 'application/json; charset=utf-8',
@@ -1315,7 +1318,25 @@ export class IPv6BlockAPI extends ParentAPI {
13151318
)
13161319

13171320
/**
1318-
* Get a specific IPv6 block. Get the IPv6 block associated with the given ID.
1321+
* List IPv6 blocks. List IPv6 blocks associated given project ID.
1322+
*
1323+
* @param request - The request {@link IPv6BlockApiListIPv6BlocksRequest}
1324+
* @returns A Promise of ListIPv6BlocksResponse
1325+
*/
1326+
listIPv6Blocks = (
1327+
request: Readonly<IPv6BlockApiListIPv6BlocksRequest> = {},
1328+
) =>
1329+
this.client.fetch<ListIPv6BlocksResponse>(
1330+
{
1331+
method: 'GET',
1332+
path: `/dedibox/v1/ipv6-blocks`,
1333+
urlParams: urlParams(['project_id', request.projectId]),
1334+
},
1335+
unmarshalListIPv6BlocksResponse,
1336+
)
1337+
1338+
/**
1339+
* Get first IPv6 block. Get the first IPv6 block associated with the given project ID.
13191340
*
13201341
* @param request - The request {@link IPv6BlockApiGetIPv6BlockRequest}
13211342
* @returns A Promise of IPv6Block

packages_generated/dedibox/src/v1/content.gen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type {
1010
ServerInstallStatus,
1111
ServerStatus,
1212
ServiceProvisioningStatus,
13-
} from './types.gen'
13+
} from './types.gen.js'
1414

1515
/** Lists transient statutes of the enum {@link BMCAccessStatus}. */
1616
export const BMC_ACCESS_TRANSIENT_STATUSES: BMCAccessStatus[] = [

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export {
88
RpnSanAPI,
99
RpnV1API,
1010
RpnV2API,
11-
} from './api.gen'
12-
export * from './content.gen'
13-
export * from './marshalling.gen'
11+
} from './api.gen.js'
12+
export * from './content.gen.js'
13+
export * from './marshalling.gen.js'
1414
export type {
1515
AttachFailoverIPsRequest,
1616
AttachFailoverIPToMacAddressRequest,
@@ -79,6 +79,7 @@ export type {
7979
IPv6BlockApiGetIPv6BlockQuotasRequest,
8080
IPv6BlockApiGetIPv6BlockRequest,
8181
IPv6BlockApiListIPv6BlockSubnetsAvailableRequest,
82+
IPv6BlockApiListIPv6BlocksRequest,
8283
IPv6BlockApiUpdateIPv6BlockRequest,
8384
IPv6BlockDelegationStatus,
8485
ListFailoverIPsRequest,
@@ -88,6 +89,7 @@ export type {
8889
ListInvoicesResponse,
8990
ListIPv6BlockSubnetsAvailableResponse,
9091
ListIPv6BlockSubnetsAvailableResponseSubnet,
92+
ListIPv6BlocksResponse,
9193
ListIpsResponse,
9294
ListOffersRequest,
9395
ListOffersRequestOrderBy,
@@ -264,5 +266,5 @@ export type {
264266
UpdateServerBackupRequest,
265267
UpdateServerRequest,
266268
UpdateServerTagsRequest,
267-
} from './types.gen'
268-
export * as ValidationRules from './validation-rules.gen'
269+
} from './types.gen.js'
270+
export * as ValidationRules from './validation-rules.gen.js'

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

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import type {
3939
ListInvoicesResponse,
4040
ListIPv6BlockSubnetsAvailableResponse,
4141
ListIPv6BlockSubnetsAvailableResponseSubnet,
42+
ListIPv6BlocksResponse,
4243
ListIpsResponse,
4344
ListOffersResponse,
4445
ListOSResponse,
@@ -131,7 +132,7 @@ import type {
131132
UpdateServerBackupRequest,
132133
UpdateServerRequest,
133134
UpdateServerTagsRequest,
134-
} from './types.gen'
135+
} from './types.gen.js'
135136

136137
export const unmarshalIP = (data: unknown): IP => {
137138
if (!isJSONObject(data)) {
@@ -731,6 +732,24 @@ export const unmarshalFailoverIP = (data: unknown): FailoverIP => {
731732
} as FailoverIP
732733
}
733734

735+
export const unmarshalIPv6Block = (data: unknown): IPv6Block => {
736+
if (!isJSONObject(data)) {
737+
throw new TypeError(
738+
`Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.`,
739+
)
740+
}
741+
742+
return {
743+
address: data.address,
744+
cidr: data.cidr,
745+
delegationStatus: data.delegation_status,
746+
duid: data.duid,
747+
id: data.id,
748+
nameservers: data.nameservers,
749+
subnets: unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block),
750+
} as IPv6Block
751+
}
752+
734753
export const unmarshalBMCAccess = (data: unknown): BMCAccess => {
735754
if (!isJSONObject(data)) {
736755
throw new TypeError(
@@ -867,24 +886,6 @@ export const unmarshalGetRpnStatusResponse = (
867886
} as GetRpnStatusResponse
868887
}
869888

870-
export const unmarshalIPv6Block = (data: unknown): IPv6Block => {
871-
if (!isJSONObject(data)) {
872-
throw new TypeError(
873-
`Unmarshalling the type 'IPv6Block' failed as data isn't a dictionary.`,
874-
)
875-
}
876-
877-
return {
878-
address: data.address,
879-
cidr: data.cidr,
880-
delegationStatus: data.delegation_status,
881-
duid: data.duid,
882-
id: data.id,
883-
nameservers: data.nameservers,
884-
subnets: unmarshalArrayOfObject(data.subnets, unmarshalIPv6Block),
885-
} as IPv6Block
886-
}
887-
888889
export const unmarshalInvoice = (data: unknown): Invoice => {
889890
if (!isJSONObject(data)) {
890891
throw new TypeError(
@@ -957,6 +958,21 @@ export const unmarshalListIPv6BlockSubnetsAvailableResponse = (
957958
} as ListIPv6BlockSubnetsAvailableResponse
958959
}
959960

961+
export const unmarshalListIPv6BlocksResponse = (
962+
data: unknown,
963+
): ListIPv6BlocksResponse => {
964+
if (!isJSONObject(data)) {
965+
throw new TypeError(
966+
`Unmarshalling the type 'ListIPv6BlocksResponse' failed as data isn't a dictionary.`,
967+
)
968+
}
969+
970+
return {
971+
ipv6Blocks: unmarshalArrayOfObject(data.ipv6_blocks, unmarshalIPv6Block),
972+
totalCount: data.total_count,
973+
} as ListIPv6BlocksResponse
974+
}
975+
960976
const unmarshalInvoiceSummary = (data: unknown): InvoiceSummary => {
961977
if (!isJSONObject(data)) {
962978
throw new TypeError(

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

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,37 @@ export interface ListIPv6BlockSubnetsAvailableResponseSubnet {
11021102
cidr: number
11031103
}
11041104

1105+
export interface IPv6Block {
1106+
/**
1107+
* ID of the IPv6.
1108+
*/
1109+
id: number
1110+
/**
1111+
* Address of the IPv6.
1112+
*/
1113+
address: string
1114+
/**
1115+
* DUID of the IPv6.
1116+
*/
1117+
duid: string
1118+
/**
1119+
* DNS linked to the IPv6.
1120+
*/
1121+
nameservers: string[]
1122+
/**
1123+
* Classless InterDomain Routing notation of the IPv6.
1124+
*/
1125+
cidr: number
1126+
/**
1127+
* All IPv6 subnets.
1128+
*/
1129+
subnets: IPv6Block[]
1130+
/**
1131+
* The nameservers delegation status.
1132+
*/
1133+
delegationStatus: IPv6BlockDelegationStatus
1134+
}
1135+
11051136
export interface InvoiceSummary {
11061137
id: number
11071138
totalWithTaxes?: Money
@@ -2003,37 +2034,6 @@ export type GetServiceRequest = {
20032034
serviceId: number
20042035
}
20052036

2006-
export interface IPv6Block {
2007-
/**
2008-
* ID of the IPv6.
2009-
*/
2010-
id: number
2011-
/**
2012-
* Address of the IPv6.
2013-
*/
2014-
address: string
2015-
/**
2016-
* DUID of the IPv6.
2017-
*/
2018-
duid: string
2019-
/**
2020-
* DNS linked to the IPv6.
2021-
*/
2022-
nameservers: string[]
2023-
/**
2024-
* Classless InterDomain Routing notation of the IPv6.
2025-
*/
2026-
cidr: number
2027-
/**
2028-
* All IPv6 subnets.
2029-
*/
2030-
subnets: IPv6Block[]
2031-
/**
2032-
* The nameservers delegation status.
2033-
*/
2034-
delegationStatus: IPv6BlockDelegationStatus
2035-
}
2036-
20372037
export type IPv6BlockApiCreateIPv6BlockRequest = {
20382038
/**
20392039
* ID of the project.
@@ -2084,6 +2084,10 @@ export type IPv6BlockApiListIPv6BlockSubnetsAvailableRequest = {
20842084
blockId: number
20852085
}
20862086

2087+
export type IPv6BlockApiListIPv6BlocksRequest = {
2088+
projectId?: string
2089+
}
2090+
20872091
export type IPv6BlockApiUpdateIPv6BlockRequest = {
20882092
/**
20892093
* ID of the IPv6 block.
@@ -2212,6 +2216,11 @@ export interface ListIPv6BlockSubnetsAvailableResponse {
22122216
totalCount: number
22132217
}
22142218

2219+
export interface ListIPv6BlocksResponse {
2220+
totalCount: number
2221+
ipv6Blocks: IPv6Block[]
2222+
}
2223+
22152224
export interface ListInvoicesResponse {
22162225
totalCount: number
22172226
invoices: InvoiceSummary[]

0 commit comments

Comments
 (0)