v1.0.0
This commit is contained in:
@@ -7,12 +7,18 @@ import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// Request struct for delete load balancer
|
||||
type DeleteRequest struct {
|
||||
LBID uint64 `url:"lbId"`
|
||||
Permanently bool `url:"permanently"`
|
||||
// ID of the load balancer instance to delete
|
||||
// Required: true
|
||||
LBID uint64 `url:"lbId"`
|
||||
|
||||
// Set to true to delete load balancer immediately bypassing recycle bin
|
||||
// Required: false
|
||||
Permanently bool `url:"permanently,omitempty"`
|
||||
}
|
||||
|
||||
func (lbrq DeleteRequest) Validate() error {
|
||||
func (lbrq DeleteRequest) validate() error {
|
||||
if lbrq.LBID == 0 {
|
||||
return errors.New("validation-error: field LBID can not be empty or equal to 0")
|
||||
}
|
||||
@@ -20,8 +26,9 @@ func (lbrq DeleteRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Delete deletes specified load balancer
|
||||
func (l LB) Delete(ctx context.Context, req DeleteRequest) (bool, error) {
|
||||
err := req.Validate()
|
||||
err := req.validate()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user