Skip to content

Commit 17accdc

Browse files
authored
feat: update generated APIs (#2072)
1 parent c93d25d commit 17accdc

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

api/ipam/v1/ipam_sdk.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,14 @@ type ReleaseIPRequest struct {
319319
IPID string `json:"-"`
320320
}
321321

322+
// ReleaseIPSetRequest: release ip set request.
323+
type ReleaseIPSetRequest struct {
324+
// Region: region to target. If none is passed will use default region from the config.
325+
Region scw.Region `json:"-"`
326+
327+
IPIDs []string `json:"ip_ids"`
328+
}
329+
322330
// UpdateIPRequest: update ip request.
323331
type UpdateIPRequest struct {
324332
// Region: region to target. If none is passed will use default region from the config.
@@ -420,6 +428,36 @@ func (s *API) ReleaseIP(req *ReleaseIPRequest, opts ...scw.RequestOption) error
420428
return nil
421429
}
422430

431+
// ReleaseIPSet:
432+
func (s *API) ReleaseIPSet(req *ReleaseIPSetRequest, opts ...scw.RequestOption) error {
433+
var err error
434+
435+
if req.Region == "" {
436+
defaultRegion, _ := s.client.GetDefaultRegion()
437+
req.Region = defaultRegion
438+
}
439+
440+
if fmt.Sprint(req.Region) == "" {
441+
return errors.New("field Region cannot be empty in request")
442+
}
443+
444+
scwReq := &scw.ScalewayRequest{
445+
Method: "POST",
446+
Path: "/ipam/v1/regions/" + fmt.Sprint(req.Region) + "/ip-sets/release",
447+
}
448+
449+
err = scwReq.SetBody(req)
450+
if err != nil {
451+
return err
452+
}
453+
454+
err = s.client.Do(scwReq, nil, opts...)
455+
if err != nil {
456+
return err
457+
}
458+
return nil
459+
}
460+
423461
// GetIP: Retrieve details of an existing IP, specified by its IP ID.
424462
func (s *API) GetIP(req *GetIPRequest, opts ...scw.RequestOption) (*IP, error) {
425463
var err error

api/rdb/v1/rdb_sdk.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,11 @@ type BackupSchedule struct {
971971
NextRunAt *time.Time `json:"next_run_at"`
972972
}
973973

974+
// EncryptionAtRest: encryption at rest.
975+
type EncryptionAtRest struct {
976+
Enabled bool `json:"enabled"`
977+
}
978+
974979
// InstanceSetting: instance setting.
975980
type InstanceSetting struct {
976981
Name string `json:"name"`
@@ -1318,6 +1323,9 @@ type Instance struct {
13181323

13191324
// Maintenances: list of Database Instance maintenance events.
13201325
Maintenances []*Maintenance `json:"maintenances"`
1326+
1327+
// Encryption: encryption at rest settings for your Database Instance.
1328+
Encryption *EncryptionAtRest `json:"encryption"`
13211329
}
13221330

13231331
// NodeType: node type.
@@ -1610,6 +1618,9 @@ type CreateInstanceRequest struct {
16101618

16111619
// BackupSameRegion: defines whether to or not to store logical backups in the same region as the Database Instance.
16121620
BackupSameRegion bool `json:"backup_same_region"`
1621+
1622+
// Encryption: encryption at rest settings for your Database Instance.
1623+
Encryption *EncryptionAtRest `json:"encryption,omitempty"`
16131624
}
16141625

16151626
// CreateReadReplicaEndpointRequest: create read replica endpoint request.

0 commit comments

Comments
 (0)