@@ -709,6 +709,72 @@ func (enum *HostStatus) UnmarshalJSON(data []byte) error {
709709 return nil
710710}
711711
712+ type InboundTransferStatus string
713+
714+ const (
715+ // Unknown status.
716+ InboundTransferStatusUnknown = InboundTransferStatus ("unknown" )
717+ // Domain transfer in progress.
718+ InboundTransferStatusInProgress = InboundTransferStatus ("in_progress" )
719+ // Domain successfully transferred.
720+ InboundTransferStatusDone = InboundTransferStatus ("done" )
721+ // Internal error.
722+ InboundTransferStatusErrInternal = InboundTransferStatus ("err_internal" )
723+ // Domain is in a pending status.
724+ InboundTransferStatusErrDomainPending = InboundTransferStatus ("err_domain_pending" )
725+ // Domain is already being transferred.
726+ InboundTransferStatusErrAlreadyTransferring = InboundTransferStatus ("err_already_transferring" )
727+ // Domain transfer is prohibited (transfer/update prohibited status or is currently locked).
728+ InboundTransferStatusErrTransferProhibited = InboundTransferStatus ("err_transfer_prohibited" )
729+ // Transfer is not supported for this TLD or the domain is premium.
730+ InboundTransferStatusErrTransferImpossible = InboundTransferStatus ("err_transfer_impossible" )
731+ // Invalid authcode.
732+ InboundTransferStatusErrInvalidAuthcode = InboundTransferStatus ("err_invalid_authcode" )
733+ // Domain name was created less than 60 days ago.
734+ InboundTransferStatusErrDomainTooYoung = InboundTransferStatus ("err_domain_too_young" )
735+ // Too many transfer requests for this domain name.
736+ InboundTransferStatusErrTooManyRequests = InboundTransferStatus ("err_too_many_requests" )
737+ )
738+
739+ func (enum InboundTransferStatus ) String () string {
740+ if enum == "" {
741+ // return default value if empty
742+ return string (InboundTransferStatusUnknown )
743+ }
744+ return string (enum )
745+ }
746+
747+ func (enum InboundTransferStatus ) Values () []InboundTransferStatus {
748+ return []InboundTransferStatus {
749+ "unknown" ,
750+ "in_progress" ,
751+ "done" ,
752+ "err_internal" ,
753+ "err_domain_pending" ,
754+ "err_already_transferring" ,
755+ "err_transfer_prohibited" ,
756+ "err_transfer_impossible" ,
757+ "err_invalid_authcode" ,
758+ "err_domain_too_young" ,
759+ "err_too_many_requests" ,
760+ }
761+ }
762+
763+ func (enum InboundTransferStatus ) MarshalJSON () ([]byte , error ) {
764+ return []byte (fmt .Sprintf (`"%s"` , enum )), nil
765+ }
766+
767+ func (enum * InboundTransferStatus ) UnmarshalJSON (data []byte ) error {
768+ tmp := ""
769+
770+ if err := json .Unmarshal (data , & tmp ); err != nil {
771+ return err
772+ }
773+
774+ * enum = InboundTransferStatus (InboundTransferStatus (tmp ).String ())
775+ return nil
776+ }
777+
712778type LinkedProduct string
713779
714780const (
@@ -2027,6 +2093,34 @@ type DomainSummary struct {
20272093 PendingTrade bool `json:"pending_trade"`
20282094}
20292095
2096+ // InboundTransfer: inbound transfer.
2097+ type InboundTransfer struct {
2098+ // ID: the unique identifier of the inbound transfer.
2099+ ID string `json:"id"`
2100+
2101+ // CreatedAt: the creation date of the inbound transfer.
2102+ CreatedAt * time.Time `json:"created_at"`
2103+
2104+ // LastUpdatedAt: the last modification date of the inbound transfer.
2105+ LastUpdatedAt * time.Time `json:"last_updated_at"`
2106+
2107+ // ProjectID: the project ID associated with the inbound transfer.
2108+ ProjectID string `json:"project_id"`
2109+
2110+ // Domain: the domain associated with the inbound transfer.
2111+ Domain string `json:"domain"`
2112+
2113+ // Status: inbound transfer status.
2114+ // Default value: unknown
2115+ Status InboundTransferStatus `json:"status"`
2116+
2117+ // Message: human-friendly message to describe the current inbound transfer status.
2118+ Message string `json:"message"`
2119+
2120+ // TaskID: the unique identifier of the associated task.
2121+ TaskID string `json:"task_id"`
2122+ }
2123+
20302124// RenewableDomain: renewable domain.
20312125type RenewableDomain struct {
20322126 Domain string `json:"domain"`
@@ -2650,6 +2744,32 @@ func (r *ListDomainsResponse) UnsafeAppend(res any) (uint32, error) {
26502744 return uint32 (len (results .Domains )), nil
26512745}
26522746
2747+ // ListInboundTransfersResponse: list inbound transfers response.
2748+ type ListInboundTransfersResponse struct {
2749+ TotalCount uint32 `json:"total_count"`
2750+
2751+ InboundTransfers []* InboundTransfer `json:"inbound_transfers"`
2752+ }
2753+
2754+ // UnsafeGetTotalCount should not be used
2755+ // Internal usage only
2756+ func (r * ListInboundTransfersResponse ) UnsafeGetTotalCount () uint32 {
2757+ return r .TotalCount
2758+ }
2759+
2760+ // UnsafeAppend should not be used
2761+ // Internal usage only
2762+ func (r * ListInboundTransfersResponse ) UnsafeAppend (res any ) (uint32 , error ) {
2763+ results , ok := res .(* ListInboundTransfersResponse )
2764+ if ! ok {
2765+ return 0 , errors .New ("%T type cannot be appended to type %T" , res , r )
2766+ }
2767+
2768+ r .InboundTransfers = append (r .InboundTransfers , results .InboundTransfers ... )
2769+ r .TotalCount += uint32 (len (results .InboundTransfers ))
2770+ return uint32 (len (results .InboundTransfers )), nil
2771+ }
2772+
26532773// ListRenewableDomainsResponse: list renewable domains response.
26542774type ListRenewableDomainsResponse struct {
26552775 TotalCount uint32 `json:"total_count"`
@@ -2972,6 +3092,19 @@ type RegistrarAPIListDomainsRequest struct {
29723092 Domain * string `json:"-"`
29733093}
29743094
3095+ // RegistrarAPIListInboundTransfersRequest: registrar api list inbound transfers request.
3096+ type RegistrarAPIListInboundTransfersRequest struct {
3097+ Page int32 `json:"-"`
3098+
3099+ PageSize * uint32 `json:"-"`
3100+
3101+ ProjectID string `json:"-"`
3102+
3103+ OrganizationID string `json:"-"`
3104+
3105+ Domain string `json:"-"`
3106+ }
3107+
29753108// RegistrarAPIListRenewableDomainsRequest: registrar api list renewable domains request.
29763109type RegistrarAPIListRenewableDomainsRequest struct {
29773110 Page * int32 `json:"-"`
@@ -3972,6 +4105,47 @@ func (s *RegistrarAPI) ListTasks(req *RegistrarAPIListTasksRequest, opts ...scw.
39724105 return & resp , nil
39734106}
39744107
4108+ // ListInboundTransfers:
4109+ func (s * RegistrarAPI ) ListInboundTransfers (req * RegistrarAPIListInboundTransfersRequest , opts ... scw.RequestOption ) (* ListInboundTransfersResponse , error ) {
4110+ var err error
4111+
4112+ defaultPageSize , exist := s .client .GetDefaultPageSize ()
4113+ if (req .PageSize == nil || * req .PageSize == 0 ) && exist {
4114+ req .PageSize = & defaultPageSize
4115+ }
4116+
4117+ if req .ProjectID == "" {
4118+ defaultProjectID , _ := s .client .GetDefaultProjectID ()
4119+ req .ProjectID = defaultProjectID
4120+ }
4121+
4122+ if req .OrganizationID == "" {
4123+ defaultOrganizationID , _ := s .client .GetDefaultOrganizationID ()
4124+ req .OrganizationID = defaultOrganizationID
4125+ }
4126+
4127+ query := url.Values {}
4128+ parameter .AddToQuery (query , "page" , req .Page )
4129+ parameter .AddToQuery (query , "page_size" , req .PageSize )
4130+ parameter .AddToQuery (query , "project_id" , req .ProjectID )
4131+ parameter .AddToQuery (query , "organization_id" , req .OrganizationID )
4132+ parameter .AddToQuery (query , "domain" , req .Domain )
4133+
4134+ scwReq := & scw.ScalewayRequest {
4135+ Method : "GET" ,
4136+ Path : "/domain/v2beta1/inbound-transfers" ,
4137+ Query : query ,
4138+ }
4139+
4140+ var resp ListInboundTransfersResponse
4141+
4142+ err = s .client .Do (scwReq , & resp , opts ... )
4143+ if err != nil {
4144+ return nil , err
4145+ }
4146+ return & resp , nil
4147+ }
4148+
39754149// BuyDomains: Request the registration of domain names.
39764150// You can provide a domain's already existing contact or a new contact.
39774151func (s * RegistrarAPI ) BuyDomains (req * RegistrarAPIBuyDomainsRequest , opts ... scw.RequestOption ) (* OrderResponse , error ) {
0 commit comments