Skip to content

Commit ca5a3d0

Browse files
chore(domain): rename from domain to domains (#1041)
Co-authored-by: Rémy Léone <[email protected]>
1 parent 8ea86c4 commit ca5a3d0

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

api/domain/v2beta1/domain_sdk.go

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,7 +1456,7 @@ type NewContact struct {
14561456
}
14571457

14581458
type OrderResponse struct {
1459-
Domain string `json:"domain"`
1459+
Domains []string `json:"domains"`
14601460

14611461
OrganizationID string `json:"organization_id"`
14621462

@@ -2729,8 +2729,8 @@ func (s *RegistrarAPI) ListTasks(req *RegistrarAPIListTasksRequest, opts ...scw.
27292729
return &resp, nil
27302730
}
27312731

2732-
type RegistrarAPIBuyDomainRequest struct {
2733-
Domain string `json:"domain"`
2732+
type RegistrarAPIBuyDomainsRequest struct {
2733+
Domains []string `json:"domains"`
27342734

27352735
DurationInYears uint32 `json:"duration_in_years"`
27362736

@@ -2755,12 +2755,12 @@ type RegistrarAPIBuyDomainRequest struct {
27552755
TechnicalContact *NewContact `json:"technical_contact,omitempty"`
27562756
}
27572757

2758-
// BuyDomain: buy a domain
2758+
// BuyDomains: buy one or more domains
27592759
//
2760-
// Request the registration of a domain name.
2760+
// Request the registration of domain names.
27612761
// You can provide an already existing domain's contact or a new contact.
27622762
//
2763-
func (s *RegistrarAPI) BuyDomain(req *RegistrarAPIBuyDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
2763+
func (s *RegistrarAPI) BuyDomains(req *RegistrarAPIBuyDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
27642764
var err error
27652765

27662766
if req.ProjectID == "" {
@@ -2770,7 +2770,7 @@ func (s *RegistrarAPI) BuyDomain(req *RegistrarAPIBuyDomainRequest, opts ...scw.
27702770

27712771
scwReq := &scw.ScalewayRequest{
27722772
Method: "POST",
2773-
Path: "/domain/v2beta1/domains",
2773+
Path: "/domain/v2beta1/buy-domains",
27742774
Headers: http.Header{},
27752775
}
27762776

@@ -2788,28 +2788,24 @@ func (s *RegistrarAPI) BuyDomain(req *RegistrarAPIBuyDomainRequest, opts ...scw.
27882788
return &resp, nil
27892789
}
27902790

2791-
type RegistrarAPIRenewDomainRequest struct {
2792-
Domain string `json:"-"`
2791+
type RegistrarAPIRenewDomainsRequest struct {
2792+
Domains []string `json:"domains"`
27932793

27942794
DurationInYears uint32 `json:"duration_in_years"`
27952795

27962796
ForceLateRenewal *bool `json:"force_late_renewal"`
27972797
}
27982798

2799-
// RenewDomain: renew a domain
2799+
// RenewDomains: renew one or more domains
28002800
//
2801-
// Request the renewal of a domain name.
2801+
// Request the renewal of domain names.
28022802
//
2803-
func (s *RegistrarAPI) RenewDomain(req *RegistrarAPIRenewDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
2803+
func (s *RegistrarAPI) RenewDomains(req *RegistrarAPIRenewDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
28042804
var err error
28052805

2806-
if fmt.Sprint(req.Domain) == "" {
2807-
return nil, errors.New("field Domain cannot be empty in request")
2808-
}
2809-
28102806
scwReq := &scw.ScalewayRequest{
28112807
Method: "POST",
2812-
Path: "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/renew",
2808+
Path: "/domain/v2beta1/renew-domains",
28132809
Headers: http.Header{},
28142810
}
28152811

0 commit comments

Comments
 (0)