Add new resources, extend fields in config

This commit is contained in:
stSolo
2022-10-06 12:53:21 +03:00
parent 5fd450382c
commit 8712561853
39 changed files with 1784 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
package rg
import (
"context"
"encoding/json"
"net/http"
)
type ListRequest struct {
IncludeDeleted bool `url:"includedeleted,omitempty"`
Page uint64 `url:"page,omitempty"`
Size uint64 `url:"size,omitempty"`
}
func (r RG) List(ctx context.Context, req ListRequest) (List, error) {
url := "/cloudbroker/rg/list"
res, err := r.client.DecortApiCall(ctx, http.MethodPost, url, req)
if err != nil {
return nil, err
}
list := List{}
err = json.Unmarshal(res, &list)
if err != nil {
return nil, err
}
return list, nil
}