Skip to content

Commit 62e22fe

Browse files
feat(domain): expose inbound transfer status (#2351)
Co-authored-by: Laure-di <[email protected]>
1 parent b0d384a commit 62e22fe

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed

packages_generated/domain/src/v2beta1/api.gen.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import {
5656
unmarshalListDNSZoneVersionsResponse,
5757
unmarshalListDomainHostsResponse,
5858
unmarshalListDomainsResponse,
59+
unmarshalListInboundTransfersResponse,
5960
unmarshalListRenewableDomainsResponse,
6061
unmarshalListSSLCertificatesResponse,
6162
unmarshalListTasksResponse,
@@ -110,6 +111,7 @@ import type {
110111
ListDNSZoneVersionsResponse,
111112
ListDomainHostsResponse,
112113
ListDomainsResponse,
114+
ListInboundTransfersResponse,
113115
ListRenewableDomainsResponse,
114116
ListSSLCertificatesRequest,
115117
ListSSLCertificatesResponse,
@@ -134,6 +136,7 @@ import type {
134136
RegistrarApiListContactsRequest,
135137
RegistrarApiListDomainHostsRequest,
136138
RegistrarApiListDomainsRequest,
139+
RegistrarApiListInboundTransfersRequest,
137140
RegistrarApiListRenewableDomainsRequest,
138141
RegistrarApiListTasksRequest,
139142
RegistrarApiListTldsRequest,
@@ -724,6 +727,43 @@ You can filter the list of tasks by domain name.
724727
listTasks = (request: Readonly<RegistrarApiListTasksRequest> = {}) =>
725728
enrichForPagination('tasks', this.pageOfListTasks, request)
726729

730+
protected pageOfListInboundTransfers = (
731+
request: Readonly<RegistrarApiListInboundTransfersRequest>,
732+
) =>
733+
this.client.fetch<ListInboundTransfersResponse>(
734+
{
735+
method: 'GET',
736+
path: `/domain/v2beta1/inbound-transfers`,
737+
urlParams: urlParams(
738+
['domain', request.domain],
739+
[
740+
'organization_id',
741+
request.organizationId ??
742+
this.client.settings.defaultOrganizationId,
743+
],
744+
['page', request.page],
745+
[
746+
'page_size',
747+
request.pageSize ?? this.client.settings.defaultPageSize,
748+
],
749+
[
750+
'project_id',
751+
request.projectId ?? this.client.settings.defaultProjectId,
752+
],
753+
),
754+
},
755+
unmarshalListInboundTransfersResponse,
756+
)
757+
758+
listInboundTransfers = (
759+
request: Readonly<RegistrarApiListInboundTransfersRequest>,
760+
) =>
761+
enrichForPagination(
762+
'inboundTransfers',
763+
this.pageOfListInboundTransfers,
764+
request,
765+
)
766+
727767
/**
728768
* Purchase domains. Request the registration of domain names.
729769
You can provide a domain's already existing contact or a new contact.

packages_generated/domain/src/v2beta1/index.gen.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ export type {
8181
ImportRawDNSZoneRequestBindSource,
8282
ImportRawDNSZoneRequestTsigKey,
8383
ImportRawDNSZoneResponse,
84+
InboundTransfer,
85+
InboundTransferStatus,
8486
LinkedProduct,
8587
ListContactsRequestRole,
8688
ListContactsResponse,
@@ -99,6 +101,7 @@ export type {
99101
ListDomainHostsResponse,
100102
ListDomainsRequestOrderBy,
101103
ListDomainsResponse,
104+
ListInboundTransfersResponse,
102105
ListRenewableDomainsRequestOrderBy,
103106
ListRenewableDomainsResponse,
104107
ListSSLCertificatesRequest,
@@ -135,6 +138,7 @@ export type {
135138
RegistrarApiListContactsRequest,
136139
RegistrarApiListDomainHostsRequest,
137140
RegistrarApiListDomainsRequest,
141+
RegistrarApiListInboundTransfersRequest,
138142
RegistrarApiListRenewableDomainsRequest,
139143
RegistrarApiListTasksRequest,
140144
RegistrarApiListTldsRequest,

packages_generated/domain/src/v2beta1/marshalling.gen.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import type {
6363
ImportRawDNSZoneRequestBindSource,
6464
ImportRawDNSZoneRequestTsigKey,
6565
ImportRawDNSZoneResponse,
66+
InboundTransfer,
6667
ListContactsResponse,
6768
ListDNSZoneNameserversResponse,
6869
ListDNSZoneRecordsResponse,
@@ -71,6 +72,7 @@ import type {
7172
ListDNSZoneVersionsResponse,
7273
ListDomainHostsResponse,
7374
ListDomainsResponse,
75+
ListInboundTransfersResponse,
7476
ListRenewableDomainsResponse,
7577
ListSSLCertificatesResponse,
7678
ListTasksResponse,
@@ -1114,6 +1116,43 @@ export const unmarshalListDomainsResponse = (
11141116
} as ListDomainsResponse
11151117
}
11161118

1119+
const unmarshalInboundTransfer = (data: unknown): InboundTransfer => {
1120+
if (!isJSONObject(data)) {
1121+
throw new TypeError(
1122+
`Unmarshalling the type 'InboundTransfer' failed as data isn't a dictionary.`,
1123+
)
1124+
}
1125+
1126+
return {
1127+
createdAt: unmarshalDate(data.created_at),
1128+
domain: data.domain,
1129+
id: data.id,
1130+
lastUpdatedAt: unmarshalDate(data.last_updated_at),
1131+
message: data.message,
1132+
projectId: data.project_id,
1133+
status: data.status,
1134+
taskId: data.task_id,
1135+
} as InboundTransfer
1136+
}
1137+
1138+
export const unmarshalListInboundTransfersResponse = (
1139+
data: unknown,
1140+
): ListInboundTransfersResponse => {
1141+
if (!isJSONObject(data)) {
1142+
throw new TypeError(
1143+
`Unmarshalling the type 'ListInboundTransfersResponse' failed as data isn't a dictionary.`,
1144+
)
1145+
}
1146+
1147+
return {
1148+
inboundTransfers: unmarshalArrayOfObject(
1149+
data.inbound_transfers,
1150+
unmarshalInboundTransfer,
1151+
),
1152+
totalCount: data.total_count,
1153+
} as ListInboundTransfersResponse
1154+
}
1155+
11171156
const unmarshalRenewableDomain = (data: unknown): RenewableDomain => {
11181157
if (!isJSONObject(data)) {
11191158
throw new TypeError(

packages_generated/domain/src/v2beta1/types.gen.ts

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,19 @@ export type DomainStatus =
137137

138138
export type HostStatus = 'unknown_status' | 'active' | 'updating' | 'deleting'
139139

140+
export type InboundTransferStatus =
141+
| 'unknown'
142+
| 'in_progress'
143+
| 'done'
144+
| 'err_internal'
145+
| 'err_domain_pending'
146+
| 'err_already_transferring'
147+
| 'err_transfer_prohibited'
148+
| 'err_transfer_impossible'
149+
| 'err_invalid_authcode'
150+
| 'err_domain_too_young'
151+
| 'err_too_many_requests'
152+
140153
export type LinkedProduct = 'unknown_product' | 'vpc'
141154

142155
export type ListContactsRequestRole =
@@ -625,6 +638,41 @@ export interface DomainSummary {
625638
pendingTrade: boolean
626639
}
627640

641+
export interface InboundTransfer {
642+
/**
643+
* The unique identifier of the inbound transfer.
644+
*/
645+
id: string
646+
/**
647+
* The creation date of the inbound transfer.
648+
*/
649+
createdAt?: Date
650+
/**
651+
* The last modification date of the inbound transfer.
652+
*/
653+
lastUpdatedAt?: Date
654+
/**
655+
* The project ID associated with the inbound transfer.
656+
*/
657+
projectId: string
658+
/**
659+
* The domain associated with the inbound transfer.
660+
*/
661+
domain: string
662+
/**
663+
* Inbound transfer status.
664+
*/
665+
status: InboundTransferStatus
666+
/**
667+
* Human-friendly message to describe the current inbound transfer status.
668+
*/
669+
message: string
670+
/**
671+
* The unique identifier of the associated task.
672+
*/
673+
taskId: string
674+
}
675+
628676
export interface RenewableDomain {
629677
domain: string
630678
projectId: string
@@ -1125,6 +1173,11 @@ export interface ListDomainsResponse {
11251173
domains: DomainSummary[]
11261174
}
11271175

1176+
export interface ListInboundTransfersResponse {
1177+
totalCount: number
1178+
inboundTransfers: InboundTransfer[]
1179+
}
1180+
11281181
export interface ListRenewableDomainsResponse {
11291182
totalCount: number
11301183
domains: RenewableDomain[]
@@ -1339,6 +1392,14 @@ export type RegistrarApiListDomainsRequest = {
13391392
domain?: string
13401393
}
13411394

1395+
export type RegistrarApiListInboundTransfersRequest = {
1396+
page: number
1397+
pageSize?: number
1398+
projectId?: string
1399+
organizationId?: string
1400+
domain: string
1401+
}
1402+
13421403
export type RegistrarApiListRenewableDomainsRequest = {
13431404
page?: number
13441405
pageSize?: number

0 commit comments

Comments
 (0)