Skip to content

Commit 7216f58

Browse files
feat(dedibox): provide ListIPv6Blocks endpoint (#2470)
Co-authored-by: Jonathan Remy <[email protected]>
1 parent f760795 commit 7216f58

File tree

4 files changed

+80
-32
lines changed

4 files changed

+80
-32
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ import {
6565
unmarshalListFailoverIPsResponse,
6666
unmarshalListInvoicesResponse,
6767
unmarshalListIPv6BlockSubnetsAvailableResponse,
68+
unmarshalListIPv6BlocksResponse,
6869
unmarshalListIpsResponse,
6970
unmarshalListOffersResponse,
7071
unmarshalListOSResponse,
@@ -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,
@@ -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/index.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,

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

Lines changed: 16 additions & 0 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,
@@ -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)