Files
decort-golang-sdk/pkg/cloudapi/locations/get_url.go
2022-08-11 16:39:39 +03:00

29 lines
554 B
Go

package locations
import (
"context"
"github.com/rudecs/decort-sdk/opts"
"github.com/rudecs/decort-sdk/typed"
)
func (l Locations) GetUrl(ctx context.Context, options ...opts.DecortOpts) (string, error) {
url := "/locations/getUrl"
prefix := "/cloudapi"
option := opts.New(options)
if option != nil {
if option.IsAdmin {
prefix = "/" + option.AdminValue
}
}
url = prefix + url
res, err := l.client.DecortApiCall(ctx, typed.POST, url, nil)
if err != nil {
return "", err
}
return string(res), nil
}